[
https://issues.apache.org/jira/browse/CAMEL-26141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18136565#comment-18136565
]
Claus Ibsen edited comment on CAMEL-26141 at 11/2/26, 8:39 PM:
---------------------------------------------------------------
Fixed in PR https://github.com/apache/camel/pull/28913.
1. A query parameter without a value (?foo, ?foo=) now gets an empty value
instead of failing with ArrayIndexOutOfBoundsException (it gave HTTP 500). A
value with = in it is kept whole, and empty parameters (&&) are skipped.
2. The useStreaming description now says it makes the consumer receive text as
a Reader and binary as an InputStream, and that the producer does not use it.
Found while testing, not fixed: with JSR 356 (the embedded Jetty in the tests),
the query parameters of the WebSocket upgrade never reach the open event
headers, and the existing test for this passes only because its asserts are
swallowed.
_Claude Code on behalf of Claus Ibsen (davsclaus)_
was (Author: davsclaus):
Fixed in PR https://github.com/apache/camel/pull/28913.
1. A query parameter without a value (?foo, ?foo=) now gets an empty value
instead of failing with ArrayIndexOutOfBoundsException (it gave HTTP 500). A
value with = in it is kept whole, and empty parameters (&&) are skipped.
2. The useStreaming description now says it makes the consumer receive text as
a Reader and binary as an InputStream, and that the producer does not use it.
Found while testing, not fixed: with JSR 356 (the embedded Jetty in the tests),
the query parameters of the WebSocket upgrade never reach the open event
headers, and the existing test for this passes only because its asserts are
swallowed. The queryMap field is also shared by all connections.
_Claude Code on behalf of Claus Ibsen (davsclaus)_
> camel-atmosphere-websocket - a query parameter without a value fails with
> ArrayIndexOutOfBoundsException, and useStreaming is documented for sending
> but only used by the consumer
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-26141
> URL: https://issues.apache.org/jira/browse/CAMEL-26141
> Project: Camel
> Issue Type: Bug
> Components: camel-atmosphere-websocket
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.24.0
>
>
> Found while adding the catalog body types of atmosphere-websocket
> (CAMEL-24961, PR #28395).
> h4. 1. A query parameter without a value fails with
> ArrayIndexOutOfBoundsException
> {{WebsocketConsumer.getQueryMap}} (main 2a465aa4814c, lines 142-143) splits
> each parameter on {{=}} and reads {{nameval[1]}}, so a query like {{?foo}}
> (or {{?foo=}}) throws {{ArrayIndexOutOfBoundsException}}. Read in the code,
> not run.
> Proposed: split with a limit of 2 and use an empty value when there is no
> {{=}}.
> h4. 2. useStreaming is documented for sending but only the consumer uses it
> The option description ({{WebsocketEndpoint.setUseStreaming}}, line 109) says
> "To enable streaming to send data as multiple text fragments", but only
> {{WebsocketConsumer}} (line 67) reads it, to pick the stream handler for
> received messages; the producer ignores it. Read in the code, not run.
> Proposed: fix the description to say it makes the consumer receive text
> messages as a stream (or make the producer stream).
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)