-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with canonicalize a protocol
getting called with an empty string
#118
Comments
Step 1 of "maybe add a part from the pending fixed value": https://wicg.github.io/urlpattern/#maybe-add-a-part-from-the-pending-fixed-value Has an early return for empty string. Is that not catching this case? |
However, I do see in the c++ implementation that I have empty string checks in all the encoding callback implementations. That's probably the most expedient fix here as well. |
To clarify, there are other places in "add a part" where we invoke the encoding callback without checking to see if the value is empty first or not. I can see in the c++ implementation that we do pass empty strings to the encoding callbacks. |
it isn't
Oh I see, i guess that is most likely what the issue is |
Make encoding callbacks short circuit on empty strings. (Fixes #118)
Given testdata
we are getting an error in the constructor at
compile a component
for protocol, as the call tocanonicalize a protocol
is happening with an empty string as argument. that call is happening inmaybe add a part from the pending fixed value
, which is getting called inadd a part
, which is called at https://wicg.github.io/urlpattern/#ref-for-add-a-part.This does seem a bug with the spec since we re-checked our code regarding the steps involved and everything seems correct, though we might have overlooked something.
The steps defined for
canonicalize a protocol
can never succeed for an empty string input.The text was updated successfully, but these errors were encountered: