Re: [url-tests] URL: change null password handling (#4405)

@annevk here is what happens in that test case of parsing `http://::@c@d:2` with the new spec:

- (A bunch of stuff...)
- authority state, c = "@", buffer = "::"
  - Set the @ flag
  - Let the passwordTokenSeenFlag be unset
  - For each code point in buffer
   - ":"
     - code point is ":" and passwordTokenSeenFlag is unset, so set setPasswordTokenSeenFlag and continue
   - ":"
     - Let encodedCodePoints = "%3A"
     - passwordTokenSeenFlag is set, so password += encodedCodePoints
     - password is now "%3A"
  - buffer = ""
- authority state, c = "c", buffer = ""
  - buffer += "c"
- authority state, c = "@", buffer = "c"
  - @ flag is set, so prepend "%40" to buffer: buffer is now "%40c"
  - Set the @ flag
  - Let the passwordTokenSeenFlag be unset
  - For each code point in buffer:
    - "%"
      - encodedCodePoints = "%"
      - username += encodedCodePoints; username is now "%"
    - "4"
      - ditto
    - Continues until username = "%40c"
  - buffer = ""
- authority state, c = "d", buffer = ""
  - buffer += "d"
- authority state, c = ":", buffer = "d"
  - buffer += ":"
- authority state, c = "2", buffer = "d:"
  - buffer += "2"
- authority state, c = EOF, buffer = "d:2"
  - pointer -= 4
  - buffer = ""
  - state = "host"

So you can see how this ends up with a username of "%40c" and a password of "%3A"

View on GitHub: https://github.com/w3c/web-platform-tests/pull/4405#issuecomment-269800986

Received on Friday, 30 December 2016 17:51:19 UTC