bchapuis commented on PR #924:
URL: 
https://github.com/apache/incubator-baremaps/pull/924#issuecomment-2614444531

   Thanks a lot for this contribution.
   
   I have tried this change with the `dev` and `serve` command of the baremaps 
CLI and got some Content Security Policy issues in the browser. After digging a 
bit, I managed to display the map by updating the value of the integrity 
attribute for the js and css files of maplibre and by adding a meta element at 
the top of the head section to declare the CSP.
   
   Here are my changes: 
   
   ```html
     <meta http-equiv="Content-Security-Policy" content="
       script-src 'self' 'unsafe-eval' 'unsafe-inline' https://unpkg.com 
https://baremaps.apache.org;
       worker-src 'self' blob:;
       child-src 'self' blob:;
       img-src 'self' data: blob: https://unpkg.com https://baremaps.apache.org;
       style-src 'self' 'unsafe-inline' https://unpkg.com 
https://baremaps.apache.org;
     ">
   
     <script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"; 
integrity="sha256-VkgYz8vlPsIndJcxwEDZKAdx4r+Ag7HcLBPP4UbJrZE=" 
crossorigin="anonymous"></script>
     <script 
src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.js"; 
integrity="sha256-NYdRoIbqeAWkTHjpa/BukMLXcsiqFoDuJCYzzaRei30=" 
crossorigin="anonymous"></script>
     <script 
src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.js";
 integrity="sha256-Jo8NvxMzooqayU8+eIsjO49b4EoakoE0o0tSSrBWPCU=" 
crossorigin="anonymous"></script>
     <script 
src="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.js"; 
integrity="sha256-80a3VIbp5OJ8HSIWJ7+6NjTvdBmVirLCR6otKucXnlw=" 
crossorigin="anonymous"></script>
     <script 
src="https://baremaps.apache.org/assets/maplibre/maplibre-gl-framerate.js"; 
integrity="sha256-6IVzv2heNDAl7KkSqjRkmjr56asfkdCxO2q8ouTo8t8=" 
crossorigin="anonymous"></script>
     <link rel="stylesheet" 
href="https://unpkg.com/[email protected]/dist/maplibre-gl.css"; 
integrity="sha256-eSrJl9z2rm9kPrTi3uRjDIXnBWUmvY+4X/6Dxn1sQbQ=" 
crossorigin="anonymous">
     <link rel="stylesheet" 
href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-inspect.css"; 
integrity="sha256-ePhsoaklgbCBxK7kfSUcP+V+bVqnfFwpILz7hkSR0Lo=" 
crossorigin="anonymous">
     <link rel="stylesheet" 
href="https://baremaps.apache.org/assets/maplibre/maplibre-gl-tile-boundaries.css";
 integrity="sha256-FxIRliWXnU67sT1i97MgNQ0qL8LjsgYiBH9v/uNxzdM=" 
crossorigin="anonymous">
     <link rel="stylesheet" 
href="https://baremaps.apache.org/assets/maplibre/maplibre-custom-controls.css"; 
integrity="sha256-rFc19qrZTPgcrNeYjtsLCcDOqM5NrLiPy2U+0FxW9vA=" 
crossorigin="anonymous">
     <link rel="icon" type="image/x-icon" 
href="https://baremaps.apache.org/assets/favicon/favicon.ico";>
     ```
     
     Can you cross check and validate that it works for you as well?


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

Reply via email to