I'm running Mapkit JS within a Cordova app. It loads the map, but tiles load intermittently and I get a lot of CSP errors in the console.
Can anyone please recommend to me, what are the best CSP settings for using Mapkit JS?
Currently I have image-src, connect-src and style-src pointing to https://*.apple-mapkit.com, as well as default-src.
The main CSP errors I'm getting are for https://gsp10-ssl.ls.apple.com ...Is this a site I should add? Or is it dynamically generated and can change often?
Thanks!
Can anyone please recommend to me, what are the best CSP settings for using Mapkit JS?
Currently I have image-src, connect-src and style-src pointing to https://*.apple-mapkit.com, as well as default-src.
The main CSP errors I'm getting are for https://gsp10-ssl.ls.apple.com ...Is this a site I should add? Or is it dynamically generated and can change often?
Thanks!
Solved the issue... Some of the CSP settings that Chrome accepted were not so gracefully accepted on Safari, which broke the map.
This final setting worked, and made the map work well on iOS, macOS Safari and macOS Chrome:
I understand that allowing blob: as a safe URL is quite risky from a security standpoint, so when I perform a security audit before release I will have to take a second look at these settings. In the meantime, for development, it gets me to the functionality I want.
This final setting worked, and made the map work well on iOS, macOS Safari and macOS Chrome:
Code Block <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://*.apple-mapkit.com https://*.ls.apple.com blob:; style-src 'self' 'unsafe-inline'; img-src 'self' https://*.apple-mapkit.com;">
I understand that allowing blob: as a safe URL is quite risky from a security standpoint, so when I perform a security audit before release I will have to take a second look at these settings. In the meantime, for development, it gets me to the functionality I want.