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

papegaaij pushed a commit to branch wicket-8.x
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/wicket-8.x by this push:
     new 689065d  WICKET-6746: no need to resolve current scheme is desired is 
ANY
689065d is described below

commit 689065dedc94e6327222009428af992ae70fb6b4
Author: Emond Papegaaij <[email protected]>
AuthorDate: Tue Feb 11 19:07:40 2020 +0100

    WICKET-6746: no need to resolve current scheme is desired is ANY
    
    Resolving the current scheme breaks on WebSocket requests when rendering
    urls for resources, because HttpsMapper only knows http and https, not
    ws.
---
 .../java/org/apache/wicket/protocol/https/HttpsMapper.java     | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git 
a/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java 
b/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java
index 411b5e9..c7dda45 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java
+++ 
b/wicket-core/src/main/java/org/apache/wicket/protocol/https/HttpsMapper.java
@@ -101,6 +101,11 @@ public class HttpsMapper implements IRequestMapperDelegate
                IRequestHandler handler = delegate.mapRequest(request);
 
                Scheme desired = getDesiredSchemeFor(handler);
+               if (Scheme.ANY.equals(desired))
+               {
+                       return handler;
+               }
+               
                Scheme current = getSchemeOf(request);
                if (!desired.isCompatibleWith(current))
                {
@@ -173,6 +178,11 @@ public class HttpsMapper implements IRequestMapperDelegate
                Url url = delegate.mapHandler(handler);
 
                Scheme desired = getDesiredSchemeFor(handler);
+               if (Scheme.ANY.equals(desired))
+               {
+                       return url;
+               }
+               
                Scheme current = getSchemeOf(request);
                if (!desired.isCompatibleWith(current))
                {

Reply via email to