-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAge
Milestone
Description
After an hour of head scratching and cursing and found that there's a strange way how ServeFile handles any path's that end with index.html
:
- Instead of serving the file directly it generates a 301 redirect response to the nearest folder
Example:
http.ServeFile(w,r,"/public/blog/index.html")
this redirects to /public/blog/
This is not mentioned in the documentation and could cause undesirable behavior.
I tried to add the note about it to the documentation but got rejected because apparently Go doesn't use Github's pull request system. So I don't know how to get this into the documentation so that others won't get tripped over it.
I would actually propose that "feature" to be removed because it's based on an arbitrary of considering the trailing slash ("/") to be the equivalent of a reference to "index.html".
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAge