Skip to content

Commit

Permalink
Media handler #10869
Browse files Browse the repository at this point in the history
  • Loading branch information
anatol-sialitski committed Jan 23, 2025
1 parent 47ecf86 commit e10f911
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ public class MediaHandler

private static final EnumSet<HttpMethod> ALLOWED_METHODS = EnumSet.of( HttpMethod.GET, HttpMethod.HEAD, HttpMethod.OPTIONS );

private static final Predicate<PortalRequest> IS_ALLOWED_METHOD = req -> ALLOWED_METHODS.contains( req.getMethod() );

private static final MediaType SVG_MEDIA_TYPE = MediaType.SVG_UTF_8.withoutParameters();

private static final int DEFAULT_BACKGROUND = 0xFFFFFF;
Expand Down Expand Up @@ -138,7 +136,7 @@ public WebResponse handle( final WebRequest webRequest )
throw createNotFoundException();
}

if ( !IS_ALLOWED_METHOD.test( portalRequest ) )
if ( !ALLOWED_METHODS.contains( portalRequest.getMethod() ) )
{
throw new WebException( HttpStatus.METHOD_NOT_ALLOWED, String.format( "Method %s not allowed", portalRequest.getMethod() ) );
}
Expand Down

0 comments on commit e10f911

Please sign in to comment.