mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-13 05:52:39 +02:00
Added tests and fixed code get it passing
This commit is contained in:
parent
dcfb286874
commit
ec264026c9
2 changed files with 81 additions and 11 deletions
37
data_test.go
37
data_test.go
|
|
@ -156,6 +156,43 @@ func TestNewRequest(t *testing.T) {
|
|||
"http://localhost/http://example.com/%2C",
|
||||
"http://example.com/%2C", emptyOptions, false,
|
||||
},
|
||||
// URI Encoded cases
|
||||
{
|
||||
"http://localhost/1x2/http%3A%2F%2Fexample.com%2Ffoo",
|
||||
"http://example.com/foo", Options{Width: 1, Height: 2}, false,
|
||||
},
|
||||
{
|
||||
"http://localhost/1x2/http%3A%2F%2Fexample.com%2Fhttp%2Fstuff",
|
||||
"http://example.com/http/stuff", Options{Width: 1, Height: 2}, false,
|
||||
},
|
||||
{
|
||||
"http://localhost/http%3A%2F%2Fexample.com%2Ffoo",
|
||||
"http://example.com/foo", emptyOptions, false,
|
||||
},
|
||||
{
|
||||
"http://localhost/http%3A%2F%2Fexample.com%2Ffoo",
|
||||
"http://example.com/foo", emptyOptions, false,
|
||||
},
|
||||
{
|
||||
"http://localhost/http%3A%2Fexample.com%2Ffoo",
|
||||
"http://example.com/foo", emptyOptions, false,
|
||||
},
|
||||
{
|
||||
"http://localhost/http%3A%2F%2F%2Fexample.com%2Ffoo",
|
||||
"http://example.com/foo", emptyOptions, false,
|
||||
},
|
||||
{
|
||||
"http://localhost//http%3A%2F%2Fexample.com%2Ffoo",
|
||||
"http://example.com/foo", emptyOptions, false,
|
||||
},
|
||||
{
|
||||
"http://localhost/http%3A%2F%2Fexample.com%2Ffoo%3Ftest%3D1%26test%3D2",
|
||||
"http://example.com/foo?test=1&test=2", emptyOptions, false,
|
||||
},
|
||||
{
|
||||
"http://localhost/1x2/http%3A%2F%2Fexample.com%2Ffoo%3Ftest%3D1%26test%3D2",
|
||||
"http://example.com/foo?test=1&test=2", Options{Width: 1, Height: 2}, false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue