Skip to content

Commit

Permalink
Assign correct response type to exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrdoherty committed Apr 6, 2024
1 parent 6d9b55d commit 22f77b3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.NewCookie;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

import org.apache.log4j.Logger;
import org.glassfish.grizzly.http.server.Request;
Expand Down Expand Up @@ -89,7 +90,7 @@ public void filter(ContainerRequestContext requestContext) throws IOException {
catch (InvalidTokenException e) {
// passed token is invalid; throw 401
LOG.warn("Received invalid bearer token for auth: " + rawToken);
throw new NotAuthorizedException(Response.noContent().build());
throw new NotAuthorizedException(Response.status(Status.UNAUTHORIZED).build());
}
}
}
Expand Down

0 comments on commit 22f77b3

Please sign in to comment.