-
Notifications
You must be signed in to change notification settings - Fork 125
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
Add context to Response for including file and file_not_found to be identified by other shelf Middleware. #436
base: master
Are you sure you want to change the base?
Conversation
…luding `file` and `file_not_found` to be identified by other Shelf `Middleware`.
…o be identified by other Shelf `Middleware`.
…the original fileSystemPath. Add `Response.context` documentation.
Need some tests here, sir. |
* Populate `context` with the file system paths used for resolution. * Possible entries: `shelf_static:file`, `shelf_static:file_not_found`, and `shelf_static:directory`.
|
@gmpassos – look at the windows failures. Looks like some path mundging needs to be done |
It's the path separator
|
Yep. You'll need to normalize those to handle windows. Always fun! |
Should be fixed now. I was using path.join in a completely wrong way:
😅 |
...needed an extra fix for |
@devoncarew @natebosch – thoughts? |
Is it ready for publishing? |
I'd like other eyes on this change first @gmpassos |
Does the code need any adjustments? Best regards. |
With the Response.context populated with the processed file, other middleware can manipulate the response in an optimized way and ensure the correct processed file. Without this, another middleware would need to guess the processed file and, in some cases, re-resolve File.stat and fix the directory path to the "index.html" path.
This is the continuation of the PR:
#395
(This was needed to release my shelf/master fork for another PR).