You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/08/21 08:13:30 UTC

[GitHub] [hadoop] elek commented on a change in pull request #1266: HDDS-1948. S3 MPU can't be created with octet-stream content-type

elek commented on a change in pull request #1266: HDDS-1948. S3 MPU can't be created with octet-stream content-type 
URL: https://github.com/apache/hadoop/pull/1266#discussion_r316050595
 
 

 ##########
 File path: hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/HeaderPreprocessor.java
 ##########
 @@ -17,39 +17,58 @@
  */
 package org.apache.hadoop.ozone.s3;
 
+import javax.annotation.Priority;
 import javax.ws.rs.container.ContainerRequestContext;
 import javax.ws.rs.container.ContainerRequestFilter;
 import javax.ws.rs.container.PreMatching;
 import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.ext.Provider;
 import java.io.IOException;
 
 /**
  * Filter to adjust request headers for compatible reasons.
+ *
+ * It should be executed AFTER signature check (VirtualHostStyleFilter).
  */
-
 @Provider
 @PreMatching
+@Priority(150)
 
 Review comment:
   > Is this priority setting is done, to perform this Preprocessing after VirtualHostStyleFilter processing. (Is there any reason to do in this order?)
   
   Yes, the Content-Type headers can be part of the headers which are part of the signature. Therefore we need to check the signature first and modify the Content-Type header after.
   
    >  Can we define these constants and use them, instead of hardcoded values.
   
   Well, it's hardcoded value anyway and used only in this one place. But I improved it with constants to express the dependencies:
   
   ```
   @Priority(VirtualHostStyleFilter.PRIORITY
       + S3GatewayHttpServer.FILTER_PRIORITY_DO_AFTER)
   public class HeaderPreprocessor implements ContainerRequestFilter {
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org