Skip to content

Commit

Permalink
Fix some proxy logic (1.16.5)
Browse files Browse the repository at this point in the history
  • Loading branch information
e3ndr committed Apr 11, 2022
1 parent d5437e8 commit d29f89e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>co.casterlabs</groupId>
<artifactId>Katana</artifactId>
<version>1.16.4</version>
<version>1.16.5</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/co/casterlabs/katana/Katana.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@Getter
public class Katana {
public static final String ERROR_HTML = "<!DOCTYPE html><html><head><title>$RESPONSECODE</title></head><body><h1>$RESPONSECODE</h1><p>$DESCRIPTION</p><br/><p><i>Running Casterlabs Katana, $ADDRESS</i></p></body></html>";
public static final String VERSION = "1.16.4";
public static final String VERSION = "1.16.5";
public static final String SERVER_DECLARATION = String.format("Katana/%s (%s)", Katana.VERSION, System.getProperty("os.name", "Generic"));

public static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static class HostConfiguration {
public String proxyUrl;

@SerializedName("proxy_path")
public String proxyPath = "*";
public String proxyPath;

@SerializedName("include_path")
public boolean includePath;
Expand All @@ -64,7 +64,10 @@ public HttpResponse serveHttp(HttpSession session, HttpRouter router) {
if (this.config.proxyPath == null) {
url += session.getUri();
} else if (this.config.includePath) {
url += session.getUri().replace(this.config.proxyPath.replace(".*", ""), "");
if (this.config.proxyPath != null) {
url += session.getUri().replace(this.config.proxyPath.replace(".*", ""), "");
}

url += session.getQueryString();
}

Expand Down

0 comments on commit d29f89e

Please sign in to comment.