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