Skip to content

Commit

Permalink
Improved ProtocolCustomizer logging (also log the URL) (#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
eshryane authored Nov 17, 2023
1 parent 3c99142 commit 15fc3d3
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.ripe.db.whois.api.httpserver;
package net.ripe.db.whois.api.httpserver;

import com.google.common.base.Splitter;
import com.google.common.base.Strings;
Expand All @@ -25,7 +25,6 @@ public class ProtocolCustomizer implements HttpConfiguration.Customizer {
@Override
public void customize(final Connector connector, final HttpConfiguration channelConfig, final Request request) {
request.setHttpURI(setScheme(request.getHttpURI(), getScheme(request)));
LOGGER.debug("Received request scheme is {}", request.getScheme());
}

private String getScheme(final Request request) {
Expand All @@ -39,12 +38,11 @@ private String getScheme(final Request request) {
return request.getScheme();
}

LOGGER.info("Scheme is {}", header); ////////////////////////////

return Iterables.getLast(COMMA_SPLITTER.split(header));
}

private static HttpURI setScheme(final HttpURI uri, final String scheme) {
LOGGER.debug("Scheme is {} for {}", scheme, uri.asString());
return HttpURI.build(uri).scheme(scheme).asImmutable();
}
}

0 comments on commit 15fc3d3

Please sign in to comment.