Skip to content

Commit 1da1dce

Browse files
committed
Exclude JSON from CORS FilesMatch to fix duplicate API header
1 parent 0943e81 commit 1da1dce

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

images/web/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN apt-get update && \
2424
&& apt-get clean && rm -rf /var/lib/apt/lists/*
2525

2626
# Download OHM Website using gitsha, faster than cloning
27-
ENV OPENHISTORICALMAP_WEBSITE_GITSHA=5f96c54eca693db48ad272b1be32d2a2f90a796b
27+
ENV OPENHISTORICALMAP_WEBSITE_GITSHA=a9a92c5ac3554ffeca489450e020de708c09e436
2828
ENV OHM_WEBSITE_URL=https://github.com/OpenHistoricalMap/ohm-website/archive/${OPENHISTORICALMAP_WEBSITE_GITSHA}.zip
2929
RUN rm -rf $workdir/* && curl -fsSL $OHM_WEBSITE_URL -o /tmp/ohm-website.zip && \
3030
unzip /tmp/ohm-website.zip -d /tmp && \

images/web/config/production.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@
6464
Header set Access-Control-Allow-Origin "*"
6565
</Directory>
6666

67-
# Allow CORS for JSON, PBF, and PNG files for map-style
68-
<FilesMatch "\.(json|pbf|png)$">
67+
# Allow CORS for PBF and PNG files for map-style.
68+
# JSON is excluded so /api/*.json keeps only the header Rails sends, avoiding a
69+
# duplicate "*, *" (issue #1377).
70+
<FilesMatch "\.(pbf|png)$">
6971
Header set Access-Control-Allow-Origin "*"
7072
Header set Access-Control-Allow-Methods "GET, OPTIONS"
7173
Header set Access-Control-Allow-Headers "Content-Type"

0 commit comments

Comments
 (0)