Skip to content

Resolve message endpoint path using request context path #400

@tkpara

Description

@tkpara

When HttpServletSseServerTransportProvider handling the GET request to establish a new SSE connection, the message endpoint is advertised using the immutable field "baseUrl" that's set in the constructor:

// Send initial endpoint event this.sendEvent(writer, ENDPOINT_EVENT_TYPE, this.baseUrl + this.messageEndpoint + "?sessionId=" + sessionId);

This will not work if clients use a different base URL to access this servlet (e.g.: using reverse proxies). The servlet implementation should allow the request context path to be used to produce the endpoint path appropriate for that request:

// Send initial endpoint event this.sendEvent(writer, ENDPOINT_EVENT_TYPE, request.getContextPath() + this.messageEndpoint + "?sessionId=" + sessionId);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions