Skip to content

Commit

Permalink
fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ideadapt committed Dec 18, 2022
1 parent fb77fdf commit e7850eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FROM openjdk:11-jre
# Set dir inside the container
WORKDIR /app

# Copy built ja file from previous "build" step to app dir
# Copy built jar file from previous "build" step to app dir
COPY --from=build /app/target/server-*.jar /app/

# Make port accessible from outside of the container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public void start() {
final boolean isCorsPreflight = request.requestMethod().equalsIgnoreCase("options");
final boolean isHello = request.pathInfo().equalsIgnoreCase("/hello");
if(!isHello && !isCorsPreflight){
final boolean clientWantsJson = request.headers("Accept").contains("application/json");
String accept = request.headers("Accept");
boolean clientWantsJson = accept != null && accept.contains("application/json");
if(!clientWantsJson){
server.halt(HttpStatus.NOT_ACCEPTABLE_406);
}
Expand Down

0 comments on commit e7850eb

Please sign in to comment.