Skip to content

Commit

Permalink
Merge pull request #65 from ligangty/main
Browse files Browse the repository at this point in the history
[cherry-pick] Disable http compression
  • Loading branch information
ligangty authored Nov 10, 2023
2 parents be5e215 + 3a31879 commit 5570cc7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.commonjava.indy.service.ui.jaxrs.content;

import io.quarkus.vertx.http.Uncompressed;
import org.commonjava.indy.service.ui.client.content.GenericContentAccessServiceClient;
import org.commonjava.indy.service.ui.models.repository.StoreType;
import org.eclipse.microprofile.openapi.annotations.Operation;
Expand Down Expand Up @@ -105,6 +106,7 @@ public Response doDelete( final @PathParam( "type" ) String type, final @PathPar
description = "Header metadata for content (or rendered listing when path ends with '/index.html' or '/'" ), } )
@HEAD
@Path( "/{path: (.*)}" )
@Uncompressed // We should never compress this because it is often used by cli tools or other non-browser tools
public Response doHead( final @PathParam( "type" ) String type, final @PathParam( "name" ) String name,
final @PathParam( "path" ) String path,
@QueryParam( CHECK_CACHE_ONLY ) final Boolean cacheOnly, @Context final UriInfo uriInfo,
Expand All @@ -126,6 +128,7 @@ public Response doHead( final @PathParam( "type" ) String type, final @PathParam
description = "Rendered content listing (when path ends with '/index.html' or '/') or Content stream" ) } )
@GET
@Path( "/{path: (.*)}" )
@Uncompressed // We should never compress this because it is often used by cli tools or other non-browser tools
public Response doGet( final @PathParam( "type" ) String type, final @PathParam( "name" ) String name,
final @PathParam( "path" ) String path, @Context final UriInfo uriInfo,
@Context final HttpServletRequest request )
Expand Down Expand Up @@ -154,6 +157,7 @@ public Response doGet( final @PathParam( "type" ) String type, final @PathParam(
description = "Rendered content listing or Content stream" )
@GET
@Path( "/" )
@Uncompressed // We should never compress this because it is often used by cli tools or other non-browser tools
public Response doGet( final @PathParam( "type" ) String type, final @PathParam( "name" ) String name,
@Context final UriInfo uriInfo, @Context final HttpServletRequest request )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.commonjava.indy.service.ui.jaxrs.content;

import io.quarkus.vertx.http.Uncompressed;
import org.apache.commons.io.IOUtils;
import org.commonjava.indy.service.ui.client.content.MavenContentAccessServiceClient;
import org.commonjava.indy.service.ui.models.repository.StoreType;
Expand Down Expand Up @@ -111,6 +112,7 @@ public Response doDelete( final @PathParam( "type" ) String type, final @PathPar
description = "Header metadata for content (or rendered listing when path ends with '/index.html' or '/'" ) } )
@HEAD
@Path( "/{path: (.*)}" )
@Uncompressed // We should never compress this because it is often used by cli tools or other non-browser tools
public Response doHead( final @PathParam( "type" ) String type, final @PathParam( "name" ) String name,
final @PathParam( "path" ) String path,
final @QueryParam( CHECK_CACHE_ONLY ) Boolean cacheOnly, final @Context UriInfo uriInfo,
Expand All @@ -132,6 +134,7 @@ public Response doHead( final @PathParam( "type" ) String type, final @PathParam
description = "Rendered content listing (when path ends with '/index.html' or '/') or Content stream" ) } )
@GET
@Path( "/{path: (.*)}" )
@Uncompressed // We should never compress this because it is often used by cli tools or other non-browser tools
public Response doGet( final @PathParam( "type" ) String type, final @PathParam( "name" ) String name,
final @PathParam( "path" ) String path, @Context final UriInfo uriInfo,
@Context final HttpServletRequest request )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.commonjava.indy.service.ui.jaxrs.content;

import io.quarkus.vertx.http.Uncompressed;
import org.commonjava.indy.service.ui.client.content.NPMContentAccessServiceClient;
import org.commonjava.indy.service.ui.models.repository.StoreType;
import org.eclipse.microprofile.openapi.annotations.Operation;
Expand Down Expand Up @@ -132,6 +133,7 @@ public Response doDelete( final @PathParam( "type" ) String type, final @PathPar
@APIResponse( responseCode = "200", description = "Header metadata for package metadata content" ), } )
@HEAD
@Path( "/{packageName}" )
@Uncompressed // We should never compress this because it is often used by cli tools or other non-browser tools
public Response doHead( final @PathParam( "type" ) String type, final @PathParam( "name" ) String name,
final @PathParam( "packageName" ) String packageName,
final @QueryParam( CHECK_CACHE_ONLY ) Boolean cacheOnly, @Context final UriInfo uriInfo,
Expand All @@ -153,6 +155,7 @@ public Response doHead( final @PathParam( "type" ) String type, final @PathParam
@APIResponse( responseCode = "200", description = "Header metadata for tarball content" ), } )
@HEAD
@Path( "/{packageName}/{versionTarball: (.*)}" )
@Uncompressed // We should never compress this because it is often used by cli tools or other non-browser tools
public Response doHead( final @PathParam( "type" ) String type, final @PathParam( "name" ) String name,
final @PathParam( "packageName" ) String packageName,
final @PathParam( "versionTarball" ) String versionTarball,
Expand All @@ -178,6 +181,7 @@ public Response doHead( final @PathParam( "type" ) String type, final @PathParam
description = "Rendered content listing or Content stream" ) } )
@GET
@Path( "/{packageName}" )
@Uncompressed // We should never compress this because it is often used by cli tools or other non-browser tools
public Response doGet( final @PathParam( "type" ) String type, final @PathParam( "name" ) String name,
final @PathParam( "packageName" ) String packageName, @Context final UriInfo uriInfo,
@Context final HttpServletRequest request )
Expand All @@ -200,6 +204,7 @@ public Response doGet( final @PathParam( "type" ) String type, final @PathParam(
description = "Content stream" ), } )
@GET
@Path( "/{packageName}/{versionTarball: (.*)}" )
@Uncompressed // We should never compress this because it is often used by cli tools or other non-browser tools
public Response doGet( final @PathParam( "type" ) String type, final @PathParam( "name" ) String name,
final @PathParam( "packageName" ) String packageName,
final @PathParam( "versionTarball" ) String versionTarball, @Context final UriInfo uriInfo,
Expand All @@ -219,6 +224,7 @@ public Response doGet( final @PathParam( "type" ) String type, final @PathParam(
description = "Rendered content listing or Content stream" )
@GET
@Path( "/" )
@Uncompressed // We should never compress this because it is often used by cli tools or other non-browser tools
public Response doGet( final @PathParam( "type" ) String type, final @PathParam( "name" ) String name,
@Context final UriInfo uriInfo, @Context final HttpServletRequest request )
{
Expand Down
9 changes: 2 additions & 7 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ quarkus:
name: "Indy"
package:
type: uber-jar
resteasy:
gzip:
enabled: true
max-input: 64M
http:
port: 8080
read-timeout: 30m
enable-compression: true
# enable-compression: true
limits:
max-body-size: 500M
max-body-size: 1000M
auth:
permission:
authenticated:
Expand All @@ -29,7 +25,6 @@ quarkus:
paths: "/api/*"
policy: permit
methods: HEAD,GET

oidc:
enabled: true
# auth-server-url: "http://localhost:8180/realms/test"
Expand Down

0 comments on commit 5570cc7

Please sign in to comment.