Skip to content

Should Trim Duplicate Slashes in WebSocket URI Path? #2036

@nervtech

Description

@nervtech

The issue I encountered is related to the way the WebSocket URL is constructed when opening the noVNC page with a query parameter for the path. The service provides a cookie for authentication with a path of /A/B, and the noVNC resources are located under /A/B/noVNC, while the WebSocket forwarding is at /A/B/console.

When opening the page with the query parameter path=/A/B/console, the WebSocket URL is automatically formed as ws://host:port//A/B/console, with two slashes in the path. This results in a problem because the browser may treat this as a different path, causing the cookie associated with /A/B to be ignored and not sent with the WebSocket request.

Is the proposed solution of automatically cleaning up duplicate leading slashes in the WebSocket URL path the best approach, or is there a better way to handle this issue?

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