Skip to content

Commit 25feaa5

Browse files
committed
Added comments regarding HTTPS proxies
1 parent 8edeae2 commit 25feaa5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/main/java/me/desair/tus/server/creation/CreationPostRequestHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public void process(HttpMethod method, TusServletRequest servletRequest,
4040

4141
//We've already validated that the current request URL matches our upload URL so we can safely use it.
4242
String uploadURI = servletRequest.getRequestURI();
43+
44+
//It's important to return relative UPLOAD URLs in the Location header in order to support HTTPS proxies
45+
//that sit in front of the web app
4346
String url = uploadURI + (StringUtils.endsWith(uploadURI, "/") ? "" : "/") + info.getId();
4447
servletResponse.setHeader(HttpHeader.LOCATION, url);
4548
servletResponse.setStatus(HttpServletResponse.SC_CREATED);

src/test/java/me/desair/tus/server/creation/ITCreationExtension.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
public class ITCreationExtension extends AbstractTusExtensionIntegrationTest {
3232

3333
private static final String UPLOAD_URI = "/test/upload";
34+
35+
//It's important to return relative UPLOAD URLs in the Location header in order to support HTTPS proxies
36+
//that sit in front of the web app
3437
private static final String UPLOAD_URL = UPLOAD_URI + "/";
3538

3639
private UUID id;

0 commit comments

Comments
 (0)