mistercrunch commented on code in PR #33603:
URL: https://github.com/apache/superset/pull/33603#discussion_r2143812365


##########
superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts:
##########
@@ -21,16 +21,22 @@ import { t } from '../translation';
 
 /**
  * Validate a [Mapbox styles 
URL](https://docs.mapbox.com/help/glossary/style-url/)
+ * or a title server URL.
  * @param v
  */
 export default function validateMapboxStylesUrl(v: unknown) {
   if (
     typeof v === 'string' &&
     v.trim().length > 0 &&
-    v.trim().startsWith('mapbox://styles/')
+    (v.trim().startsWith('mapbox://styles/') ||
+      v.trim().startsWith('tile://http') ||
+      v.trim().includes('osm') ||

Review Comment:
   this seems a bit dangerous, seems startswith `https://tile.osm` or 
`https://tile.openstreetmap` might be safer. There's probably a fancy 
one-liner-type expression like `allowedPrefix.some(s => v.startswith(s)))`



-- 
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