Commit 1a5d653
authored
docs(filters): note static() second-parameter file vs. directory pitfall (#3965)
Issue #2233 documented a confusing redirect: setting `static("/foo",
"/tmp/foo/index.html")` (with the second parameter pointing directly at
a file named `index.html`) returns `301 Moved Permanently` with
`Location: ..//`. The cause is Go's `http.FileServer` "redirect any
request ending in /index.html to the same path without the final
index.html" behavior, inherited transitively by `static()`.
The reporter asked to document this as an edge case in the filter docs.
The existing `Notes` list near the `static` filter does mention the
symmetric case (`GET /foo/index.html` redirects to `/foo/`) but doesn't
call out that pointing the second parameter at a file - rather than its
parent directory - hits the same redirect. This PR adds one bullet
covering that case, with the fix (use the parent directory) inline.
No code changes; doc-only.
Closes #2233.
This contribution was developed with AI assistance (Claude Code).
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>1 parent 78e71cf commit 1a5d653
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1127 | 1127 | | |
1128 | 1128 | | |
1129 | 1129 | | |
| 1130 | + | |
1130 | 1131 | | |
1131 | 1132 | | |
1132 | 1133 | | |
| |||
0 commit comments