-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44348 from zakkak/2024-11-06-fix-brotli-decompres…
…sion-43392 Enable Brotli decompression
- Loading branch information
Showing
7 changed files
with
309 additions
and
46 deletions.
There are no files selected for viewing
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
7 changes: 7 additions & 0 deletions
7
...x-http-compressors/all/src/main/java/io/quarkus/compressors/it/AllDecompressResource.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.quarkus.compressors.it; | ||
|
||
import jakarta.ws.rs.Path; | ||
|
||
@Path("/decompressed") | ||
public class AllDecompressResource extends DecompressResource { | ||
} |
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
3 changes: 3 additions & 0 deletions
3
integration-tests/vertx-http-compressors/all/src/test/resources/application.properties
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
90 changes: 90 additions & 0 deletions
90
...ertx-http-compressors/app/src/main/java/io/quarkus/compressors/it/DecompressResource.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package io.quarkus.compressors.it; | ||
|
||
import jakarta.ws.rs.Consumes; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.PUT; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
/** | ||
* Resource with endpoints that consume compressed data | ||
* in POST and PUT bodies from the client. | ||
* Depending on the accept-encoding, the data is then | ||
* compressed again and sent to the client | ||
* </br> | ||
* e.g. Client sends a gzipped POST body and receives | ||
* a brotli compressed response body. | ||
* </br> | ||
* The endpoint looks like a dummy echo service, but | ||
* there is compression and decompression going on behind | ||
* the scenes in Vert.x. -> Netty. | ||
* </br> | ||
* See: https://github.com/quarkusio/quarkus/pull/44348 | ||
*/ | ||
public class DecompressResource { | ||
|
||
@POST | ||
@Path("/text") | ||
@Consumes(MediaType.TEXT_PLAIN) | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String textPost(String text) { | ||
return text; | ||
} | ||
|
||
@PUT | ||
@Path("/text") | ||
@Consumes(MediaType.TEXT_PLAIN) | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String textPut(String text) { | ||
return text; | ||
} | ||
|
||
@POST | ||
@Path("/json") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
public String jsonPost(String json) { | ||
return json; | ||
} | ||
|
||
@PUT | ||
@Path("/json") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
public String jsonPut(String json) { | ||
return json; | ||
} | ||
|
||
@POST | ||
@Path("/xml") | ||
@Produces(MediaType.TEXT_XML) | ||
@Consumes(MediaType.TEXT_XML) | ||
public String xmlPost(String xml) { | ||
return xml; | ||
} | ||
|
||
@PUT | ||
@Path("/xml") | ||
@Produces(MediaType.TEXT_XML) | ||
@Consumes(MediaType.TEXT_XML) | ||
public String xmlPut(String xml) { | ||
return xml; | ||
} | ||
|
||
@POST | ||
@Path("/xhtml") | ||
@Produces(MediaType.APPLICATION_XHTML_XML) | ||
@Consumes(MediaType.APPLICATION_XHTML_XML) | ||
public String xhtmlPost(String xhtml) { | ||
return xhtml; | ||
} | ||
|
||
@PUT | ||
@Path("/xhtml") | ||
@Produces(MediaType.APPLICATION_XHTML_XML) | ||
@Consumes(MediaType.APPLICATION_XHTML_XML) | ||
public String xhtmlPut(String xhtml) { | ||
return xhtml; | ||
} | ||
} |
Oops, something went wrong.