Skip to content
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

Static asset file server wrapper #22

Merged
merged 2 commits into from
Jul 6, 2020

Conversation

unai-programmfabrik
Copy link
Contributor

  • Added wrapper handler for static serve files in order to apply some modifications to response if possible
  • Added content-length skip modification to static serve files
  • Documented the query string parameter in request url for static file without content-length

… modifications to response if possible

- Added content-length skip modification to static serve files
- Documented the query string parameter in request url for static file without content-length
Copy link
Contributor

@martinrode martinrode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a rename

README.md Outdated
Comment on lines 1598 to 1600
#### Skip Content-Length header

For some tests, you may not want the Content-Length header to be sent alongside the asset
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name this "No Content-Length" header.

http_server.go Outdated
Comment on lines 72 to 74
skipContentLengthHeader := qs.Get("skip-content-length")
if skipContentLengthHeader == "1" || skipContentLengthHeader == "true" {
w.Header().Set("Content-Encoding", "identity")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "no-content-length".

@martinrode martinrode merged commit ec68634 into master Jul 6, 2020
@martinrode martinrode deleted the feature/custom-static-server-handler branch July 6, 2020 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants