You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2019/06/12 14:27:26 UTC

[sling-whiteboard] 03/11: Send back user-agent to help identify which requests come through

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit a45edb6d0e8bba7535c34c7266562c82175e178c
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Jun 7 11:47:48 2019 +0200

    Send back user-agent to help identify which requests come through
---
 .../test/java/org/apache/sling/uca/impl/MisbehavingServerExtension.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/url-connection-agent/src/test/java/org/apache/sling/uca/impl/MisbehavingServerExtension.java b/url-connection-agent/src/test/java/org/apache/sling/uca/impl/MisbehavingServerExtension.java
index 702b82f..601adfd 100644
--- a/url-connection-agent/src/test/java/org/apache/sling/uca/impl/MisbehavingServerExtension.java
+++ b/url-connection-agent/src/test/java/org/apache/sling/uca/impl/MisbehavingServerExtension.java
@@ -94,6 +94,8 @@ class MisbehavingServerExtension implements BeforeAllCallback, AfterAllCallback,
             public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
                     throws IOException, ServletException {
                 response.setStatus(HttpServletResponse.SC_NO_CONTENT);
+                if ( baseRequest.getHeader("User-Agent") != null )
+                    response.addHeader("Original-User-Agent", baseRequest.getHeader("User-Agent"));
                 baseRequest.setHandled(true);
             }
         });