Skip to content

Commit bc41b93

Browse files
Allow registration of binary content types
1 parent 0fa8730 commit bc41b93

File tree

1 file changed

+20
-0
lines changed
  • aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/model

1 file changed

+20
-0
lines changed

aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/model/ContainerConfig.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.amazonaws.serverless.proxy.internal.servlet.AwsProxyHttpServletRequest;
55

66
import java.util.ArrayList;
7+
import java.util.HashSet;
78
import java.util.List;
89

910

@@ -38,6 +39,7 @@ public static ContainerConfig defaultConfig() {
3839
private List<String> validFilePaths;
3940
private List<String> customDomainNames;
4041
private boolean queryStringCaseSensitive;
42+
private final HashSet<String> binaryContentTypes = new HashSet<>();
4143

4244
public ContainerConfig() {
4345
validFilePaths = new ArrayList<>();
@@ -219,4 +221,22 @@ public boolean isQueryStringCaseSensitive() {
219221
public void setQueryStringCaseSensitive(boolean queryStringCaseSensitive) {
220222
this.queryStringCaseSensitive = queryStringCaseSensitive;
221223
}
224+
225+
/**
226+
* Configure specified content type as binary
227+
*/
228+
public void addBinaryContentType(String type) {
229+
if(type != null) {
230+
binaryContentTypes.add(type);
231+
}
232+
}
233+
234+
/**
235+
* Determine if specified content type has been configured as binary
236+
* @param type
237+
* @return
238+
*/
239+
public boolean isBinaryContentType(String type) {
240+
return binaryContentTypes.contains(type);
241+
}
222242
}

0 commit comments

Comments
 (0)