bito-code-review[bot] commented on PR #42005:
URL: https://github.com/apache/superset/pull/42005#issuecomment-4962475883

   <!-- Bito Reply -->
   The flagged issue is correct. The current regex 
`//dashboard/[^/]+/embedded/?|/embedded/[^/]+/?/` matches any string containing 
these patterns, allowing false positives like `/dashboard/123/embeddedXYZ`. To 
resolve this, you should enforce a segment boundary using a lookahead or by 
explicitly matching the end of the string or path delimiters.
   
   To fix this, update the regex to require a boundary after the embedded 
segment:
   
   ```typescript
   const EMBEDDED_ROUTE_REGEX =
     /\/dashboard\/[^/]+\/embedded($|[/?#])|\/embedded\/[^/]+($|[/?#])/;
   ```
   
   This ensures that `embedded` is followed by the end of the string, a slash, 
a question mark, or a hash, preventing partial matches on longer segments. 
There are no other comments on this PR to address.
   
   **superset-frontend/src/middleware/loggerMiddleware.ts**
   ```
   const EMBEDDED_ROUTE_REGEX =
     /\/dashboard\/[^/]+\/embedded($|[/?#])|\/embedded\/[^/]+($|[/?#])/;
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to