Commit bc6ba6a
committed
Redirect to path+/ if path doesn't end with /
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 GMT1 parent 1d9dcf3 commit bc6ba6a
File tree
2 files changed
+34
-2
lines changed- lib
- src
- tests/integration_test/client
2 files changed
+34
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
173 | 184 | | |
174 | 185 | | |
175 | 186 | | |
| |||
244 | 255 | | |
245 | 256 | | |
246 | 257 | | |
247 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
248 | 271 | | |
249 | 272 | | |
250 | 273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
676 | 685 | | |
677 | 686 | | |
678 | 687 | | |
| |||
0 commit comments