Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
add test for 406 error response
Browse files Browse the repository at this point in the history
  • Loading branch information
aaperis committed Apr 21, 2023
1 parent f883dec commit d495228
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,16 @@ func (suite *ProxyTests) TestServeHTTP_allowed() {
proxy.ServeHTTP(w, r)
assert.Equal(suite.T(), 200, w.Result().StatusCode)
assert.Equal(suite.T(), true, suite.fakeServer.PingedAndRestore())

// Filenames with platform incompatible characters are disallowed
// not checked in TestServeHTTP_allowed() because we look for a non 403 response
r.Method = "PUT"
r.URL, _ = url.Parse("/username/fi|le")
w = httptest.NewRecorder()
proxy.ServeHTTP(w, r)
assert.Equal(suite.T(), 406, w.Result().StatusCode)
assert.Equal(suite.T(), false, suite.fakeServer.PingedAndRestore())

}

func (suite *ProxyTests) TestMessageFormatting() {
Expand Down

0 comments on commit d495228

Please sign in to comment.