This is an automated email from the ASF dual-hosted git repository.
papegaaij pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git
The following commit(s) were added to refs/heads/master by this push:
new a868311 WICKET-6746: no need to resolve current scheme is desired is
ANY
a868311 is described below
commit a868311d1875454129baac75e620a13c0311bb28
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))
{