Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Commit

Permalink
feat(backend): add more supported image types
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Jan 16, 2023
1 parent de344e3 commit 743a1a6
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions backend/src/main/java/io/papermc/hangarauth/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ public ByteArrayHttpMessageConverter byteArrayHttpMessageConverter() {
return converter;
}

private List<MediaType> getSupportedMediaTypes() {
return List.of(
MediaType.IMAGE_JPEG,
MediaType.IMAGE_PNG,
MediaType.APPLICATION_OCTET_STREAM,
MediaType.IMAGE_GIF,
new MediaType("image", "svg+xml"),
new MediaType("image", "webp"),
new MediaType("image", "apng"),
new MediaType("image", "avif")
);
}

@Bean
public Filter identifyFilter() {
return new OncePerRequestFilter() {
Expand All @@ -71,16 +84,6 @@ public FilterRegistrationBean<ShallowEtagHeaderFilter> shallowEtagHeaderFilterFi
return bean;
}

private List<MediaType> getSupportedMediaTypes() {
return List.of(
MediaType.IMAGE_JPEG,
MediaType.IMAGE_PNG,
MediaType.APPLICATION_OCTET_STREAM,
new MediaType("image", "svg+xml"),
new MediaType("image", "webp")
);
}

@Override
public void addCorsMappings(final CorsRegistry registry) {
final String[] avatarCorsOrigins = new String[this.generalConfig.allowedOrigins().length + 1];
Expand Down

0 comments on commit 743a1a6

Please sign in to comment.