Mise en place CORS sur object storage
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

Mise en place CORS sur object storage

by
BriceA
Created on 2022-01-24 10:35:45 (edited on 2024-09-04 10:53:18) in Public Cloud OVHcloud

Bonjour,

J'ai suivi le tutoriel suivant pour mettre en place une politique CORS sur un de mes conteneurs publiques Object Storage : https://docs.ovh.com/fr/storage/pcs/cors/

Malgré cela, les accès effectués depuis mon site web sont rejetés par le navigateur avec le message suivant (firefox): Blocage d’une requête multiorigines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur https://musician-cafe.s3.sbg.cloud.ovh.net/media/3?X-Amz-Content-Sha256=UN.... Raison : l’en-tête CORS « Access-Control-Allow-Origin » est manquant.

Quand je regarde le détail de la réponse du serveur cloud OVH, il n'y a effectivement aucun header allow-origin présent dans la réponse.

Le container object-storage semble pourtant bien configuré. J'ai copié-collé le résultat de la commande "swift stat musician-cafe" ci dessous.

Une idée de comment régler ce problème ?

D'avance merci,
Brice

Account: AUTH_...
Container: musician-cafe
Objects: 139
Bytes: 353905863
Read ACL: .r:*,.rlistings
Write ACL:
Sync To:
Sync Key:
Meta Access-Control-Expose-Headers: X-Container-Meta-Access-Control-Allow-Origin
Meta Access-Control-Allow-Origin: https://www.musician.cafe
Meta Access-Control-Max-Age: 60
X-Storage-Policy: PCS
Accept-Ranges: bytes
Last-Modified: Sat, 22 Jan 2022 14:45:26 GMT
X-Timestamp: 1642843912.81919
Content-Type: text/plain; charset=utf-8
Vary: Accept
X-Trans-Id: tx89...
X-Openstack-Request-Id: tx89...
X-Iplb-Request-Id: 923B...
X-Iplb-Instance: 42540