Skip to content

Commit 0023ee9

Browse files
committed
fix(httploader): error handling for no such host
1 parent 3bf4015 commit 0023ee9

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

‎imagor_test.go‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,7 @@ func TestNewBlobFromPathNotFound(t *testing.T) {
253253
w := httptest.NewRecorder()
254254
app.ServeHTTP(w, r)
255255
assert.Equal(t, 404, w.Code)
256-
e := ErrNotFound
257-
e.Data = "foobar"
258-
assert.Equal(t, jsonStr(e), w.Body.String())
256+
assert.Equal(t, jsonStr(ErrNotFound), w.Body.String())
259257

260258
app = New(
261259
WithDebug(true),
@@ -618,9 +616,7 @@ func TestWithLoadersStoragesProcessors(t *testing.T) {
618616
http.MethodGet, "https://example.com/unsafe/empty", nil))
619617
time.Sleep(time.Millisecond * 10)
620618
assert.Equal(t, 404, w.Code)
621-
e := ErrNotFound
622-
e.Data = "empty"
623-
assert.Equal(t, jsonStr(e), w.Body.String())
619+
assert.Equal(t, jsonStr(ErrNotFound), w.Body.String())
624620
assert.Nil(t, store.Map["empty"])
625621
})
626622
t.Run(fmt.Sprintf("not found on pass %d", i), func(t *testing.T) {
@@ -629,9 +625,7 @@ func TestWithLoadersStoragesProcessors(t *testing.T) {
629625
http.MethodGet, "https://example.com/unsafe/boooo", nil))
630626
time.Sleep(time.Millisecond * 10)
631627
assert.Equal(t, 404, w.Code)
632-
e := ErrNotFound
633-
e.Data = "boooo"
634-
assert.Equal(t, jsonStr(e), w.Body.String())
628+
assert.Equal(t, jsonStr(ErrNotFound), w.Body.String())
635629
})
636630
t.Run(fmt.Sprintf("unexpected error %d", i), func(t *testing.T) {
637631
w := httptest.NewRecorder()

0 commit comments

Comments
 (0)