Skip to content

Commit

Permalink
Add redirect scheme (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyrocknroll authored and tuteng committed Oct 31, 2019
1 parent 83c59fb commit ee8afba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public class LocationHeaderRewritingFilter extends ZuulFilter {
@Value("${redirect.port}")
private String port;

@Value("${redirect.scheme}")
private String scheme;
@Override
public String filterType() {
return POST_TYPE;
Expand Down Expand Up @@ -86,7 +88,7 @@ public Object run() {
UriComponents redirectedUriComps = redirectedUriBuilder.build();

String modifiedLocation = redirectedUriBuilder
.scheme(originalRequestUri.getScheme())
.scheme(scheme)
.host(host)
.port(port).replacePath(redirectedUriComps.getPath())
.queryParam("redirect", true)
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ pulsar-manager.password=pulsar
bookie.host=http://localhost:8050
bookie.enable=false

redirect.scheme=http
redirect.host=localhost
redirect.port=9527

Expand Down

0 comments on commit ee8afba

Please sign in to comment.