Skip to content

Fragment identifiers are not allowed in WebSocket URLs #31

Description

@ruzkant

The ServerBuilder has this default line:

	private URL urlBuilder = new URL(DomGlobal.window.location.getHref());

So that clients only need to set the path by default:

builder.setPath("my-app");

But urls with fragments like this fail:
http://localhost:8080/my-app/#myfragment

So imagine someone uses something like Nalu with the hash fragments and refreshes the browser.

You will get an error like this:

(SyntaxError) : Failed to construct 'WebSocket': The URL contains a fragment identifier ('myfragment?checksum=6804f2dc783c239cc63a2fc3138dcc28cd1f06d824a8bb1f07f7bc50028dcf10e7e069d2184de800'). Fragment identifiers are not allowed in WebSocket URLs.

Default value should ideally exclude fragments.

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