RESOLVED FIXED 284588
Null-check baseURL parameter when it is provided with an input URLPatternInit
https://bugs.webkit.org/show_bug.cgi?id=284588
Summary Null-check baseURL parameter when it is provided with an input URLPatternInit
jlee53
Reported 2024-12-12 16:19:51 PST
Currently, implementation is checking to see if the input URLPatternInit's baseURL field has a value. This is incorrect. The spec actually states that we should be checking the baseURLString parameter of the match() function.
Attachments
jlee53
Comment 1 2024-12-12 16:29:48 PST
I also am updating the function declarations to match the IDL spec. The idl spec says that they should be optional and they currently are not. [CallWith=CurrentScriptExecutionContext] boolean test(optional URLPatternInput input, optional USVString baseURL); [CallWith=CurrentScriptExecutionContext] URLPatternResult? exec(optional URLPatternInput input, optional USVString baseURL); diff --git a/Source/WebCore/Modules/url-pattern/URLPattern.h b/Source/WebCore/Modules/url-pattern/URLPattern.h index 3569a61912af..d979bcaf9395 100644 --- a/Source/WebCore/Modules/url-pattern/URLPattern.h +++ b/Source/WebCore/Modules/url-pattern/URLPattern.h - ExceptionOr<bool> test(ScriptExecutionContext&, std::optional<URLPatternInput>&&, String&& baseURL) const; + ExceptionOr<bool> test(ScriptExecutionContext&, std::optional<URLPatternInput>&&, std::optional<String>&& baseURL) const; - ExceptionOr<std::optional<URLPatternResult>> exec(ScriptExecutionContext&, std::optional<URLPatternInput>&&, String&& baseURL) const; + ExceptionOr<std::optional<URLPatternResult>> exec(ScriptExecutionContext&, std::optional<URLPatternInput>&&, std::optional<String>&& baseURL) const;
jlee53
Comment 2 2024-12-13 00:22:40 PST
EWS
Comment 3 2024-12-13 14:09:28 PST
Committed 287815@main (c1be3898e16f): <https://commits.webkit.org/287815@main> Reviewed commits have been landed. Closing PR #37897 and removing active labels.
Radar WebKit Bug Importer
Comment 4 2024-12-13 14:10:28 PST
Note You need to log in before you can comment on or make changes to this bug.