Skip to content

Commit

Permalink
Add skipHandlers method (#11)
Browse files Browse the repository at this point in the history
* Add skipHandlers method

* Google Java Format

---------

Co-authored-by: github-actions <>
  • Loading branch information
SentryMan authored Nov 20, 2024
1 parent 3fabc34 commit 8448d13
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions avaje-sigma/src/main/java/io/avaje/sigma/HttpContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ default String formParam(String key) {
*/
String result();

/** Skip further request handling, */
void skipRemainingHandlers();

/** whether the the remaining handlers will be skipped */
boolean handlersSkipped();

/**
* Returns the value of the specified request header.
*
Expand Down
11 changes: 11 additions & 0 deletions avaje-sigma/src/main/java/io/avaje/sigma/core/SigmaContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ final class SigmaContext implements HttpContext {

private String body;
private boolean base64Encoded;
private boolean skipRemaining;

SigmaContext(ServiceManager mgr, AWSRequest req, Context ctx, String matchedPath) {
this(mgr, req, ctx, matchedPath, Map.of());
Expand Down Expand Up @@ -210,6 +211,16 @@ public HttpContext result(Object content) {
return this;
}

@Override
public void skipRemainingHandlers() {
this.skipRemaining = true;
}

@Override
public boolean handlersSkipped() {
return skipRemaining;
}

@Override
public HttpContext base64EncodedResult(String content) {
this.base64Encoded = true;
Expand Down

0 comments on commit 8448d13

Please sign in to comment.