-
Notifications
You must be signed in to change notification settings - Fork 520
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
wrap-resource should set basic response headers #21
Comments
This is actually one of the things that is planned for Ring 1.2.0. The new not-modified middleware will handle "304 Not Modified" responses for handlers that return a response with a "Last Modified" or "Etag" header. The next step is to change |
Here's a patch:
|
Would it be possible to open up a pull request for that? It makes keeping track of patches a little easier. |
This has been merged in. |
wrap-resource doesn't make an attempt to set any response headers, such as last-modified and content-length; and wrap-file-info isn't compatible with wrap-resource unless the resource came from a file on the class-path. If the resource came from a jar file, we end up without the response headers set.
I package my app as an uber-jar, so I'd like wrap-resource to support conditional gets.
It is easy enough to get the content-length and last-modified date for a resource URL, using something like the following. This works whether the resource comes from a file or a jar file (or anywhere else for that matter)
Could we incorporate something like this into wrap-resource?
The text was updated successfully, but these errors were encountered: