Repository navigation
Conversation
UriTemplate.extract searches the template anywhere in the uri and throws when it is not there. A url outside the endpoint made the upgrade predicate throw and Undertow answer 500: on a port carrying two websocket paths, every station on the second one was refused this way. A url that only contained the endpoint, such as /ws/OK/extra or /ocpp/ws/OK, was accepted as the station OK. extractChargingStationOcppId now returns null unless the uri matches the template exactly, and when the id cannot be decoded. The upgrade is then refused as a client error. A trailing slash and a double slash are still accepted. Closes IZIVIA#133
|
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



OcppWsEndpoint.extractChargingStationOcppIdnow returnsnullunless the URL matches/<path>/{id}exactly (or the id cannot be decoded), so a WebSocket upgrade outside the endpoint is refused with a 4xx instead of a 500, and a second WebSocket path on the same port (/ws20/OKnext tows16) connects again (500 → 101).Behaviour change: URLs that only contain the endpoint, such as
/ws/OK/extraor/ocpp/ws/OK(a proxy adding a prefix), used to connect as stationOK(101) and are now refused (400); a trailing slash and a double slash are still accepted.Tests: unit cases in
OcppWsEndPointTestplus a toolkitWebsocketEndpointPathTestcovering two paths on one port and a single path; they assert a 4xx rather than a fixed code because a refused upgrade answers 400 ondevand 404 once #134 is merged, after which/ws16/REFUSEDon a two-path port is expected to answer 404 (not covered here).Closes #133