Skip to content

Commit

Permalink
Merge pull request #5549 from andreramos89/BISERVER-15031
Browse files Browse the repository at this point in the history
[BISERVER-15031] - Limit the PIR Export via REST API to the allowed types - null protection missing
  • Loading branch information
smmribeiro authored Feb 28, 2024
2 parents 990beac + 591a95b commit d66163c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,12 @@ protected Response doService( String contextId, String resourceId ) throws Objec
}

private boolean validatePrptiOutputFormat() {
String outputFormat = this.httpServletRequest.getParameterMap().get( "output-target" )[0];
return AllowedPrptiTypes.getByType( outputFormat ) != null;
boolean valid = true;
if ( this.httpServletRequest.getParameterMap() != null && this.httpServletRequest.getParameterMap().containsKey( "output-target" ) ) {
String outputFormat = this.httpServletRequest.getParameterMap().get( "output-target" )[0];
valid = AllowedPrptiTypes.getByType( outputFormat ) != null;
}
return valid;
}

abstract class CGFactory implements ContentGeneratorDescriptor {
Expand Down

0 comments on commit d66163c

Please sign in to comment.