Skip to content

Commit

Permalink
Support for 303 in response.
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Oct 17, 2018
1 parent f2d5091 commit f428f0a
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,13 @@ public ServerResponse<T> redirect(String location)
return this;
}

public ServerResponse<T> redirect(String location, int status)
{
this.location = location;
this.status = status;
return this;
}

public ServerResponse<T> redirectPermanently(String location)
{
this.location = location;
Expand Down Expand Up @@ -581,7 +588,7 @@ public void send(final HttpHandler handler, final HttpServerExchange exchange) t
exchange.getResponseHeaders().put(Headers.LOCATION, this.location);
}

if(this.status == StatusCodes.FOUND || this.status == StatusCodes.MOVED_PERMANENTLY || this.status == StatusCodes.TEMPORARY_REDIRECT || this.status == StatusCodes.PERMANENT_REDIRECT )
if(this.status == StatusCodes.FOUND || this.status == StatusCodes.MOVED_PERMANENTLY || this.status == StatusCodes.TEMPORARY_REDIRECT || this.status == StatusCodes.SEE_OTHER || this.status == StatusCodes.PERMANENT_REDIRECT )
{
if( (this.status == StatusCodes.FOUND || this.status == StatusCodes.MOVED_PERMANENTLY) && (this.method != null) )
{
Expand Down

0 comments on commit f428f0a

Please sign in to comment.