WICG/sms-one-time-codes

Allowing multiple whitespace between host and code

majido opened this issue · 2 comments

IMHO the current parsing logic is a bit too strict when handling the space between host and code:

  1. It requires exactly one SPACE
  2. It requires SPACE and not a more general whitespace which includes TAB as well.

I suggest we relax these two requirements.

A secondary but somewhat related concern the parsing logic in some places uses ASCII whitespace and in some place uses SPACE. I think it would be much easier to have a single concept of white space that we use in the whole parsing algorithm.

This could be either:

  • ASCII whitespace: which includes U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, or U+0020 SPACE. One concern is that it includes LF and CR which are not relevant given that parsing is happening on a single line.
  • Custom define white space for this spec to just be: U+0020 SPACE + U+0009 TAB

Seems reasonable to me. @hober WDYT?

context for @hober : this came up while code reviewing the implementation of the spec here.

Sent a PR to at least make whitespace definition consistent in parsing.

#10