mirror of
https://github.com/google/nomulus
synced 2025-12-23 06:15:42 +00:00
Use https in RDAP URLs provided (#2807)
Load balancer / internal redirections can result in the final request URL lacking "https" when finally getting to the servlet. As a result, even if you use https in the request, the resulting URL can be plain http. We need to include the actual (HTTPS) URL in the output, so replace it.
This commit is contained in:
@@ -135,7 +135,8 @@ public final class RequestModule {
|
||||
@Provides
|
||||
@RequestUrl
|
||||
static String provideRequestUrl(HttpServletRequest req) {
|
||||
return req.getRequestURL().toString();
|
||||
String url = req.getRequestURL().toString();
|
||||
return url.startsWith("https") ? url : url.replaceFirst("http", "https");
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
||||
Reference in New Issue
Block a user