Skip to content

How do you concatenate an "undefined" URL prefix? #1867

Open
@gsnedders

Description

@gsnedders

https://w3c.github.io/webdriver/#dfn-url-prefix defines "URL prefix" to be (ECMAScript's) undefined or a path-absolute URL (an Infra string).

Then in match a request we look at the "concatenation of the URL prefix and the entry's URI template" (step 2) and the "concatenation of URL prefix with entry's URI template" (step 7).

If "URL prefix" is undefined, how is it intended to concatenate them?

Given it's an ECMAScript value, my first assumption would be that we'd use ECMAScript's Addition Operator, then e.g. for a URI template of /session we'd get undefined/session, which for HTTP/1.1 is not a valid request-target.

Also potentially surprising is behaviour if the "URL prefix" is something ending in "/", for example "/". In this case, concatenating the URL prefix and the entry's URI template for a URI template of session would result in //session.

Given ChromeDriver, GeckoDriver, and SafariDriver all expect URLs such as http://localhost:1234/session (and fail given http://localhost:1234//session), this implies the "URL prefix" is actually the empty string in all three cases — which isn't clearly allowed per spec. It would be valid per spec if we defined concatenating undefined to coerce undefined to the empty string, but we don't. That said, it's unclear what we gain by defining it to be undefined rather than the empty string?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions