Re: [w3c/ServiceWorker] Add a static routing API support. (PR #1686)

@yoshisatoyanagisawa commented on this pull request.



> +        1. Set |routerRules| to [=/service worker=]'s [=static router rules object=].
+
+      <section>
+        <h5 id="verify-router-rule-algorithm"><dfn>VerifyRouterRule</dfn></h5>
+          : Input
+          :: |rule|, RouterRule
+          : Output
+          :: a boolean
+
+          1. If |rule|'s |condition| is empty, and abort these steps.
+          1. If |rule|'s |condition|'s |urlPattern| is empty, return false..
+          1. If |urlPattern| contains a regular expression, return false.
+
+             Note: Since running a user-defined regular expression has a security concern, it is prohibited.
+
+          1. If |urlPattern| cannot be [=urlpattern/parsed=], return false.

It might be the "parse a constructor string" algorithm in the future, but it should currently be the "parse a pattern string" algorithm, and only supports pathname.  I clarified that.
I clarified what "cannot be parsed" mean here.  TypeError by parser is "cannot be parsed".
As URLPattern spec do, let me make urlPattern has an associated component.  I am not sure what is an appropriate way to write it down.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1686#discussion_r1260883900
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/pull/1686/review/1525914857@github.com>

Received on Wednesday, 12 July 2023 09:23:57 UTC