-
Notifications
You must be signed in to change notification settings - Fork 42
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
First steps to add encoding capability to outbound traffic #73
Merged
Conversation
This file contains 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
String.getBytes() encode a string using the platform default encoding. In RenderableString, the string was encoded without using the Charset specified or didn't specify the default Charset if no Charset was set. Now, when using RenderableString, it will always specify the charset.
A ContentEncoder encodes an InputStream to a given compression format
- GZIP - DEFLATE - IDENTITY
Default is enabled
EncodingHelp allows to parse the Accept_Encoding header and sort the encoding methods according (mostly) to HTTP/1.1
Result parameter as null was not handled
These annotations allow to override the application configuration regarding content encoding. They can be set both on class & methods
* maxSize is the upper boundary for encoding * minSize is the lower boundary for encoding
* if renderable.length is not in encoding boundaries, abort encoding * shouldEncode now take a renderable as parameter, preparing for filter on extensions
Changing package names to org.wisdom.content.codecs
* Adding AbstractDefInfCodec for Gzip and Deflate * Adding in file documentation
Moving shouldEncode from WisdomHandler to EncodingHelper
* shouldEncode is now in EncodingHelper * parseAcceptEncodingHeader now correctly handle wildcard "*"
* Add default value for encoding.global : true * Add encoding.stream configuration key to allow stream encoding (no size check !) * Add default value for encoding.stream : true
Should encode will not check stream size in encoding.stream is set to true in the configuration
* Adding get functions * Update Configuration Unit Test
* Added a ContentEncodingHelper interface * Provide a ContentEncodingHelperImpl in content-manager as a service * Retrieval through content-engine * Updated UT (was throwing null pointer)
* Add UT and FakeControllers * Add mockito dependency * Modifications to ContentEncodingHelperImpl to satisfy tests
* Configuration keys * URL encoding * MimeType filtering * Cosmetic changes
This PR is now ready for review & merge. Interaction between cache and encoding should be examined. |
* add fromAsync parameter to write / finalizeWrite to know is their call is from an async result and need cleanup at the end * Remove cleanup after AsyncResult handling as there could be an async content encoding running * Extract content encoding from process result to handle it in writeResponse * Add a proceedAsyncEncoding function to encode content InputStream asynchronously * FinalizeWrite now check if the call is from an Async function and if keepAlive is not set, cleanup this handler
Conflicts: wisdom-api/src/main/java/org/wisdom/api/bodies/RenderableString.java wisdom-api/src/main/java/org/wisdom/api/utils/KnownMimeTypes.java wisdom-engine/src/main/java/org/wisdom/engine/server/WisdomHandler.java
Conflicts: application-configuration/src/main/java/org/wisdom/configuration/ApplicationConfigurationImpl.java application-configuration/src/test/java/org/wisdom/configuration/ApplicationConfigurationTest.java wisdom-api/src/main/java/org/wisdom/api/configuration/ApplicationConfiguration.java
cescoffier
added a commit
that referenced
this pull request
Feb 28, 2014
First steps to add encoding capability to outbound traffic
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.
Need Review
Merge Candidate
Here are first steps of adding encoding to Wisdom as stated in #10
Done :
ToDo :
Future Work :
To discuss :
I also made a change to RenderableString, as the Charset was not used to convert the string to bytes. Need reviews. (I think it is linked to #42)