How do you concatenate an "undefined" URL prefix?
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 718
- Forks
- 228
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the URL prefix definition and the “match a request” steps 2 and 7 in the WebDriver specification, then compare them with ECMAScript’s Addition Operator and HTTP request-target requirements. Check the stated ChromeDriver, GeckoDriver, and SafariDriver behavior. Done means the specification clearly defines the prefix value and concatenation behavior, including trailing-slash cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100