Skip to content

Commit

Permalink
No logic change, just improve logging (apache#241)
Browse files Browse the repository at this point in the history
This IT helped a lot to figure out problems around parallel deploy,
and I had locally applied these changes to improve ability to
track down what is actually happening on server side.
  • Loading branch information
cstamas authored Feb 15, 2023
1 parent d45dba3 commit 3747448
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,16 @@ protected void setUp()
public void handle( String target, Request baseRequest, HttpServletRequest request,
HttpServletResponse response )
{
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
String tn = Thread.currentThread().getName();
System.out.println( tn + " Handling (proxy) " + request.getMethod() + " " + request.getRequestURL() );

String auth = request.getHeader( "Proxy-Authorization" );
if ( auth != null )
{
auth = auth.substring( auth.indexOf( ' ' ) + 1 ).trim();
auth = new String( Base64.getDecoder().decode( auth ), StandardCharsets.US_ASCII );
}
System.out.println( "Proxy-Authorization: " + auth );
System.out.println( tn + " Proxy-Authorization: " + auth );

if ( !"proxyuser:proxypass".equals( auth ) )
{
Expand All @@ -109,6 +110,7 @@ public void handle( String target, Request baseRequest, HttpServletRequest reque
deployedResource.contentLength = request.getHeader( "Content-Length" );

deployedResources.add( deployedResource );
System.out.println( tn + " Done (proxy) " + request.getMethod() + " " + request.getRequestURL() );
}
};

Expand All @@ -118,7 +120,8 @@ public void handle( String target, Request baseRequest, HttpServletRequest reque
public void handle( String target, Request baseRequest, HttpServletRequest request,
HttpServletResponse response )
{
System.out.println( "Handling " + request.getMethod() + " " + request.getRequestURL() );
String tn = Thread.currentThread().getName();
System.out.println( tn + " Handling (repos) " + request.getMethod() + " " + request.getRequestURL() );

if ( "PUT".equalsIgnoreCase( request.getMethod() ) )
{
Expand All @@ -140,6 +143,7 @@ public void handle( String target, Request baseRequest, HttpServletRequest reque
deployedResource.contentLength = request.getHeader( "Content-Length" );

deployedResources.add( deployedResource );
System.out.println( tn + " Done (repos) " + request.getMethod() + " " + request.getRequestURL() );
}
};

Expand Down

0 comments on commit 3747448

Please sign in to comment.