-
Notifications
You must be signed in to change notification settings - Fork 133
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
Fixes #164 #167
Fixes #164 #167
Conversation
I think your changes here look good, but doing some testing I found some odd behavior. I'm not 100% sure of all my conclusions, but I put together draft PR for your reference for possible inclusion into this change. #169 |
Co-authored-by: Javier Evans <[email protected]>
This change adds three new flags when using curl to hit endpoints as part of integration tests: --connect-timeout 3 --max-time 30 --no-progress-meter
This change allows for the test script to be run against a container that is using a custom nginx build compiled with the --with-debug flag.
The newest changes to njs require additional dependencies for compilation. This change adds those dependencies and brings the compiler flags closer to the configuration provided by the OSS packages.
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.
@dekobon I think these changes will accomplish the fix for issue #164
We have not received confirmation from the original reporter but some time has passed and this certainly a bug so I think we can move ahead with the fix.
If you could just look over my removal of the debug code and give a 👍 then I think we can merge.
This PR fixes the issue nginxinc#164 ## Expectations This solution assumes that the following configuration options are set to true * `APPEND_SLASH_FOR_POSSIBLE_DIRECTORY` * `PROVIDE_INDEX_PAGE` * `ALLOW_DIRECTORY_LIST` Given a folder `test` **with** an `index.html` present in the directory, the `index.html` should be served for: * `/test` * `/test/` * `/test?foo=bar` * `/test/?foo=bar` Given a folder `test` **WITHOUT** an `index.html` present in the directory, files in the directory should be listed for: * `/test` * `/test/` * `/test?foo=bar` * `/test/?foo=bar` ## Notes * The `@trailslash` was rewriting to `$request_uri` with a trailing slash on the end. In the case of `/test?foo=bar` we'd wind up with `/test?foo=bar/` which when combined with the other changes led to a rewrite loop * Changed the check for directory or file to consider the path without anchor or querystring * Added yet another integration test suite and shuffled around the conditionals that maybe make the tests even more confusing - but do cover this case. Co-authored-by: Javier Evans <[email protected]> * make the isDirectory check simpler and more inclusive of error states * Allow useful output from curl and enable timeouts This change adds three new flags when using curl to hit endpoints as part of integration tests: --connect-timeout 3 --max-time 30 --no-progress-meter --------- Co-authored-by: Javier Evans <[email protected]>
This PR fixes the issue #164
Expectations
This solution assumes that the following configuration options are set to true
APPEND_SLASH_FOR_POSSIBLE_DIRECTORY
PROVIDE_INDEX_PAGE
ALLOW_DIRECTORY_LIST
Given a folder
test
with anindex.html
present in the directory, theindex.html
should be served for:/test
/test/
/test?foo=bar
/test/?foo=bar
Given a folder
test
WITHOUT anindex.html
present in the directory, files in the directory should be listed for:/test
/test/
/test?foo=bar
/test/?foo=bar
Notes
@trailslash
was rewriting to$request_uri
with a trailing slash on the end. In the case of/test?foo=bar
we'd wind up with/test?foo=bar/
which when combined with the other changes led to a rewrite loop