Skip to content

Commit

Permalink
BXC-3284 fix path with URL encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharon Luong committed Nov 14, 2023
1 parent 3f9b8b2 commit fe9c781
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import java.io.OutputStream;
import java.net.URI;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

import javax.servlet.http.HttpServletResponse;

Expand Down Expand Up @@ -55,9 +57,10 @@ public void setHttpClientConnectionManager(HttpClientConnectionManager manager)
public void getMetadata(String id, OutputStream outStream,
HttpServletResponse response, int retryServerError) {

var idPathEncoded = URLEncoder.encode(idToPath(id, 4, 2), StandardCharsets.UTF_8);
var idEncoded = URLEncoder.encode(id, StandardCharsets.UTF_8);
StringBuilder path = new StringBuilder(getImageServerProxyBasePath());
path.append(idToPath(id, 4, 2))
.append(id).append(".jp2").append("/info.json");
path.append(idPathEncoded).append(idEncoded).append(".jp2").append("/info.json");

int statusCode = -1;
String statusLine = null;
Expand Down

0 comments on commit fe9c781

Please sign in to comment.