|
@@ -53,31 +53,31 @@ func TestGetFilenameForDownload(t *testing.T) {
|
|
|
expected string
|
|
|
}{
|
|
|
{
|
|
|
- path: "http://www.example.com/",
|
|
|
+ path: "https://www.example.com/",
|
|
|
expected: "",
|
|
|
},
|
|
|
{
|
|
|
- path: "http://www.example.com/xyz",
|
|
|
+ path: "https://www.example.com/xyz",
|
|
|
expected: "xyz",
|
|
|
},
|
|
|
{
|
|
|
- path: "http://www.example.com/xyz.html",
|
|
|
+ path: "https://www.example.com/xyz.html",
|
|
|
expected: "xyz.html",
|
|
|
},
|
|
|
{
|
|
|
- path: "http://www.example.com/xyz/",
|
|
|
+ path: "https://www.example.com/xyz/",
|
|
|
expected: "",
|
|
|
},
|
|
|
{
|
|
|
- path: "http://www.example.com/xyz/uvw",
|
|
|
+ path: "https://www.example.com/xyz/uvw",
|
|
|
expected: "uvw",
|
|
|
},
|
|
|
{
|
|
|
- path: "http://www.example.com/xyz/uvw.html",
|
|
|
+ path: "https://www.example.com/xyz/uvw.html",
|
|
|
expected: "uvw.html",
|
|
|
},
|
|
|
{
|
|
|
- path: "http://www.example.com/xyz/uvw/",
|
|
|
+ path: "https://www.example.com/xyz/uvw/",
|
|
|
expected: "",
|
|
|
},
|
|
|
{
|
|
@@ -114,23 +114,23 @@ func TestGetFilenameForDownload(t *testing.T) {
|
|
|
expected: "xyz.html",
|
|
|
},
|
|
|
{
|
|
|
- disposition: "attachment; filename=\"xyz\"",
|
|
|
+ disposition: `attachment; filename="xyz"`,
|
|
|
expected: "xyz",
|
|
|
},
|
|
|
{
|
|
|
- disposition: "attachment; filename=\"xyz.html\"",
|
|
|
+ disposition: `attachment; filename="xyz.html"`,
|
|
|
expected: "xyz.html",
|
|
|
},
|
|
|
{
|
|
|
- disposition: "attachment; filename=\"/xyz.html\"",
|
|
|
+ disposition: `attachment; filename="/xyz.html"`,
|
|
|
expected: "xyz.html",
|
|
|
},
|
|
|
{
|
|
|
- disposition: "attachment; filename=\"/xyz/uvw\"",
|
|
|
+ disposition: `attachment; filename="/xyz/uvw"`,
|
|
|
expected: "uvw",
|
|
|
},
|
|
|
{
|
|
|
- disposition: "attachment; filename=\"Naïve file.txt\"",
|
|
|
+ disposition: `attachment; filename="Naïve file.txt"`,
|
|
|
expected: "Naïve file.txt",
|
|
|
},
|
|
|
}
|