New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proxy/proxy.go: disable directory indexes #133
Conversation
5466765
to
ce23b12
Compare
if err != nil { | ||
return nil, err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one exception we need to make here: /
If the name is /
, you can return the file descriptor normally. Otherwise, the UI will not work. 😄
Making this change causes the currently failing test (systemtestSuite.TestUIResponseHeaders
) to pass, so we'll need to add another one which hits a different directory like /assets
or something.
ce23b12
to
86d4c7e
Compare
For the test, just add a new test function to basic_test.go and you'll basically just need the equivalent of these two lines: https://github.com/contiv/auth_proxy/blob/master/systemtests/basic_test.go#L107-L108 I'd test that |
86d4c7e
to
351b61b
Compare
@dseevr: I've made all the changes and the CI is green. PTAL |
systemtests/basic_test.go
Outdated
runTest(func(ms *MockServer) { | ||
resp, _ := proxyGet(c, noToken, "/") | ||
c.Assert(resp.StatusCode, Equals, 200) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of these tests can be inside the same runTest
call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dseevr: I've made the change. PTAL
351b61b
to
74eb12e
Compare
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
74eb12e
to
9794463
Compare
This PR makes the needed changes to avoid listing directories with static assets.