Merge ~hloeung/ubuntu-mirror-charm:cors into ubuntu-mirror-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: ac61981f730e20f92fcd8552a07e2fc0c4f4d163
Merged at revision: 46b3d4999f1e53dae3acf7805f03296bbd1db7c5
Proposed branch: ~hloeung/ubuntu-mirror-charm:cors
Merge into: ubuntu-mirror-charm:master
Diff against target: 39 lines (+12/-0)
2 files modified
templates/apache-cloud-images.tmpl (+4/-0)
tests/unit/testdata/cloud-images/cloud-images.txt (+8/-0)
Reviewer Review Type Date Requested Status
Loïc Gomez +1 Approve
Canonical IS Reviewers Pending
Review via email: mp+458316@code.launchpad.net

Commit message

Add CORS allow header for cloud-images *:download.json files

Description of the change

On testing:

$ curl --resolve cloud-images.ubuntu.com:443:91.189.91.123 --head -v https://cloud-images.ubuntu.com/releases/streams/v1/com.ubuntu.cloud:released:download.json -o /dev/null 2>&1 | grep '^<'
< HTTP/1.1 200 OK
< Date: Wed, 10 Jan 2024 04:30:38 GMT
< Server: Apache/2.4.29 (Ubuntu)
< Last-Modified: Fri, 05 Jan 2024 16:29:04 GMT
< ETag: "d96131-60e3558afea59"
< Accept-Ranges: bytes
< Content-Length: 14246193
< Vary: Accept-Encoding
< Access-Control-Allow-Origin: *
< Content-Type: application/json

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Loïc Gomez (kotodama) :
review: Approve (+1)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 46b3d4999f1e53dae3acf7805f03296bbd1db7c5

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/templates/apache-cloud-images.tmpl b/templates/apache-cloud-images.tmpl
2index 02923a7..ad8c892 100644
3--- a/templates/apache-cloud-images.tmpl
4+++ b/templates/apache-cloud-images.tmpl
5@@ -34,6 +34,10 @@
6 IndexIgnore favicon.ico
7 AllowOverride FileInfo Indexes
8 </Directory>
9+
10+ <FilesMatch ".+:download.json$">
11+ Header set Access-Control-Allow-Origin "*"
12+ </FilesMatch>
13 </VirtualHost>
14
15 #end for
16diff --git a/tests/unit/testdata/cloud-images/cloud-images.txt b/tests/unit/testdata/cloud-images/cloud-images.txt
17index 1f008a2..855ef07 100644
18--- a/tests/unit/testdata/cloud-images/cloud-images.txt
19+++ b/tests/unit/testdata/cloud-images/cloud-images.txt
20@@ -22,6 +22,10 @@
21 IndexIgnore favicon.ico
22 AllowOverride FileInfo Indexes
23 </Directory>
24+
25+ <FilesMatch ".+:download.json$">
26+ Header set Access-Control-Allow-Origin "*"
27+ </FilesMatch>
28 </VirtualHost>
29
30 <VirtualHost 91.189.88.247:443 [2001:67c:1360:8001::33]:443>
31@@ -56,5 +60,9 @@
32 IndexIgnore favicon.ico
33 AllowOverride FileInfo Indexes
34 </Directory>
35+
36+ <FilesMatch ".+:download.json$">
37+ Header set Access-Control-Allow-Origin "*"
38+ </FilesMatch>
39 </VirtualHost>
40

Subscribers

People subscribed via source and target branches