Add context to Response for including file and file_not_found to be identified by other shelf Middleware.#436
Open
gmpassos wants to merge 19 commits intodart-lang:masterfrom
Open
Add context to Response for including file and file_not_found to be identified by other shelf Middleware.#436gmpassos wants to merge 19 commits intodart-lang:masterfrom
gmpassos wants to merge 19 commits intodart-lang:masterfrom
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.
Member
|
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`.
Contributor
Author
|
Member
|
@gmpassos – look at the windows failures. Looks like some path mundging needs to be done |
Contributor
Author
|
It's the path separator |
Member
|
Yep. You'll need to normalize those to handle windows. Always fun! |
Contributor
Author
|
Should be fixed now. I was using path.join in a completely wrong way: 😅 |
Contributor
Author
|
...needed an extra fix for |
kevmoo
reviewed
Jun 14, 2024
Member
|
@devoncarew @natebosch – thoughts? |
Contributor
Author
|
Is it ready for publishing? |
Member
|
I'd like other eyes on this change first @gmpassos |
Contributor
Author
Does the code need any adjustments? Best regards. |
Contributor
Author
|
Any update? Best regards. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).