Fix keep-alive for static content; refactor multipart module and class attributes#24
Merged
Conversation
Use `cache-control: no-store` unless overridden by the user application. The server does not currently implement cache-validation or conditional request mechanisms. Disabling client-side caching avoids stale content and provides deterministic behavior during development and deployment.
Examples and user applications require 415 (Unsupported Media Type) for incompatible requests.
Decouple state machine extensions from the HTTP parser class by storing additional properties in a dictionary with lazy initialization. Move boundary parsing to the multipart parser module and always compute boundary delimiters from the stored boundary property instead of storing them as standalone properties.
Remove exception messages used for troubleshooting, and disambiguate response messages used by the file server API.
'Connection: keep-alive' was not working for static file serving because of the missing update of the HttpEngine._is_req_complete property. The aforementioned property controls early socket closure when the indicated payload size does not match the content length.
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.
Additionally, add default cache-control policy, and introduce HTTP 415 response status.