Redirect to path+/ if path doesn't end with /#2409
Open
luk1337 wants to merge 1 commit intodrogonframework:masterfrom
Open
Redirect to path+/ if path doesn't end with /#2409luk1337 wants to merge 1 commit intodrogonframework:masterfrom
luk1337 wants to merge 1 commit intodrogonframework:masterfrom
Conversation
6e66cbb to
ba1b24c
Compare
If HTML document uses relative paths, it'll fail to load them otherwise. $ echo hello > index.html && mkdir test && echo world > test/index.html $ curl -I http://127.0.0.1:8848 HTTP/1.1 200 OK content-length: 13 content-type: text/html; charset=utf-8 server: drogon/1.9.11 date: Wed, 26 Nov 2025 13:09:28 GMT $ curl -I http://127.0.0.1:8848/test HTTP/1.1 301 Moved Permanently content-length: 0 content-type: text/html; charset=utf-8 server: drogon/1.9.11 location: /test/ date: Wed, 26 Nov 2025 13:09:33 GMT $ curl -I http://127.0.0.1:8848/test/ HTTP/1.1 200 OK content-length: 6 content-type: text/html; charset=utf-8 server: drogon/1.9.11 accept-range: bytes expires: Thu, 01 Jan 1970 00:00:00 GMT last-modified: Wed, 26 Nov 2025 13:08:38 GMT date: Wed, 26 Nov 2025 13:09:34 GMT
Contributor
Author
|
rebased to make CI fully green, no additional changes have been made. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If HTML document uses relative paths, it'll fail to load them otherwise.
$ echo hello > index.html && mkdir test && echo world > test/index.html
$ curl -I http://127.0.0.1:8848
HTTP/1.1 200 OK
content-length: 13
content-type: text/html; charset=utf-8
server: drogon/1.9.11
date: Wed, 26 Nov 2025 13:09:28 GMT
$ curl -I http://127.0.0.1:8848/test
HTTP/1.1 301 Moved Permanently
content-length: 0
content-type: text/html; charset=utf-8
server: drogon/1.9.11
location: /test/
date: Wed, 26 Nov 2025 13:09:33 GMT
$ curl -I http://127.0.0.1:8848/test/
HTTP/1.1 200 OK
content-length: 6
content-type: text/html; charset=utf-8
server: drogon/1.9.11
accept-range: bytes
expires: Thu, 01 Jan 1970 00:00:00 GMT
last-modified: Wed, 26 Nov 2025 13:08:38 GMT
date: Wed, 26 Nov 2025 13:09:34 GMT