Skip to content

Commit

Permalink
Update unauthorized access error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Mar 3, 2023
1 parent e9bb94e commit cf2017a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Proteus Changelog.
## Unreleased
### No issue

**Silence cached compiler logs and upgrade to blackbird**


[e9bb94e12f4589d](https://github.com/noboomu/proteus/commit/e9bb94e12f4589d) Joshua Bauer *2023-02-08 19:42:32*

**Improve compatability**


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,19 @@ public HttpHandler wrap(HttpHandler handler)

if(keyValue.isEmpty() || !keyValue.get().equals(API_KEY))
{
StringBuilder sb = new StringBuilder();

sb.append("\n");

exchange.getRequestHeaders().forEach(h -> {

sb.append(h.getHeaderName()).append(": ").append(h.getFirst()).append("\n");

});

logger.error("Missing security credentials");
exchange.putAttachment(THROWABLE, new ServerException("Unauthorized access", Response.Status.UNAUTHORIZED));
throw new ServerException("Unauthorized access", Response.Status.UNAUTHORIZED);
exchange.putAttachment(THROWABLE, new ServerException("Unauthorized access: " + sb, Response.Status.UNAUTHORIZED));
throw new ServerException("Unauthorized access: " + sb, Response.Status.UNAUTHORIZED);

}

Expand Down

0 comments on commit cf2017a

Please sign in to comment.