jakartaee / jakartaee/websocket

Interaction with Servlet Filters, Listeners and RequestDispatchers is unclear

Open
#188 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
78
Forks
47
Avg merge
1h 32m
Merged PRs (30d)
1

Description

The spec is unclear as to when ServerEndpointConfig instances registered with a ServerContainer and Endpoint onOpen methods are invoked.

Consider a JSR356 enabled servlet container with the following mappings

/* SomeFilter
/foo/bar/* FooBarServlet
/foo/

{param}

/* MyEndpointConfig
/other/* OtherServlet

Is the SomeFilter doFilter method invoked for a websocket upgrade request to /foo/bar/info ?

If so, does the getServletPath method return the mapping for the FooBarServlet or the MyEndpointConfig? What happens if the filter wraps the request, can this effect the matching to an EndpointConfig?

If the checkOrigin method returns false, is the request then handled normally by the Filter and Servlet?

If a websocket upgrade request is received with a URI of /other/info, can the OtherServet use a RequestDispatcher.forward to /foo/bar/info and have the connection accepted by the MyEndpointConfig ?

Similarly, are ServletRequestListener instances called before/after websocket handshake handling and if so, what is the getServletPath set to?
#### Affected Versions
[1.0]

Contributor guide

Open the contributing guide

Research direction

Start with the JSR356 servlet mappings and lifecycle points named in the issue: SomeFilter, FooBarServlet, MyEndpointConfig, OtherServlet, Endpoint.onOpen, ServerEndpointConfig, ServletRequestListener, and RequestDispatcher.forward. Resolve the behavior for upgrade requests, wrapped requests, rejected origins, forwards, and listener timing, then document the resulting specification rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.