Skip to content

Commit

Permalink
route: use flag to mark HTTP head
Browse files Browse the repository at this point in the history
  • Loading branch information
jknack committed May 12, 2024
1 parent 8018014 commit b38339a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jooby/src/main/java/io/jooby/Route.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ public interface Handler extends Serializable, Aware {

private Method mvcMethod;

private boolean httpHead;

/**
* Creates a new route.
*
Expand Down Expand Up @@ -833,7 +835,7 @@ public boolean isHttpTrace() {
* @return True if route support HTTP HEAD.
*/
public boolean isHttpHead() {
return getMethod().equals(Router.GET) && isHttpMethod(Router.HEAD);
return httpHead;
}

/**
Expand Down Expand Up @@ -866,6 +868,7 @@ public boolean isHttpHead() {
*/
public @NonNull Route setHttpHead(boolean enabled) {
addHttpMethod(enabled, Router.HEAD);
this.httpHead = enabled;
return this;
}

Expand Down

0 comments on commit b38339a

Please sign in to comment.