[
https://issues.apache.org/jira/browse/CXF-7799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16548323#comment-16548323
]
ASF GitHub Bot commented on CXF-7799:
-------------------------------------
reta closed pull request #430: [CXF-7799] Extract queryString from
AtmosphereRequest path
URL: https://github.com/apache/cxf/pull/430
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
index 3c6ffff280d..ae35901a4b3 100644
---
a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
+++
b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
@@ -269,6 +269,13 @@ protected AtmosphereRequest
createAtmosphereRequest(AtmosphereRequest r, byte[]
throw new InvalidPathException();
}
+ String queryString = "";
+ int index = path.indexOf("?");
+ if (index != -1) {
+ queryString = path.substring(index + 1);
+ path = path.substring(0, index);
+ }
+
String requestURI = path;
String requestURL = r.getRequestURL() +
requestURI.substring(r.getRequestURI().length());
String contentType = hdrs.get("Content-Type");
@@ -280,6 +287,7 @@ protected AtmosphereRequest
createAtmosphereRequest(AtmosphereRequest r, byte[]
.method(method)
.requestURI(requestURI)
.requestURL(requestURL)
+ .queryString(queryString)
.request(r);
// add the body only if it is present
byte[] body = WebSocketUtils.readBody(in);
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Query parameters are not handled properly when WebSocket transport is used
> --------------------------------------------------------------------------
>
> Key: CXF-7799
> URL: https://issues.apache.org/jira/browse/CXF-7799
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS, Transports
> Affects Versions: 3.2.5
> Reporter: Alexander Onnikov
> Assignee: Andriy Redko
> Priority: Minor
>
> I'm trying to pass query parameters to REST endpoint over Websocket
> transport. I expect the passed parameters to come as query string but instead
> of this I receive them in the path.
> I suppose that there is an issue with Atmosphere that causes it not to pass
> query parameters to AtmosphereRequest.
>
> Request example ([JAX-RS WebSocket
> Demo|https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/websocket]):
> GET /demo/customerservice/customers/123?param=value
> Expected: "123" is passed as a path parameter value
> Actual: value is "123?param=value"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)