La configuración de orígenes CORS no funciona

I want to embed the latest updates from our community on my website:

To accomplish this, I am trying to access the latest.json and will parse that appropriately and embed on my site:

I went to admin and setup the CORS origins:

I even updated app.yml with the following lines and rebuild the whole thing:
DISCOURSE_ENABLE_CORS: true
DISCOURSE_CORS_ORIGIN: ‘https://www.schulminator.com/
I don’t know if this is needed but it does work with this setting or without.

But still same issue as you check on this site:

Access to XMLHttpRequest at ‘https://community.schulminator.com/latest.json’ from origin ‘https://www.schulminator.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

I am really stuck here…

3 Me gusta

Same problem here
Has someone been able to get it work?

3 Me gusta

Si alguien tiene un problema similar con una configuración de CORS, por favor verifica que hayas eliminado la barra final de tu enlace. Un error tonto que me costó un par de horas de mi tiempo. :sweat_smile:

5 Me gusta

Creo que el consejo sobre la configuración de CORS debería hacerse definitivamente más claro:

Texto actual

Orígenes permitidos para solicitudes entre orígenes (CORS). Cada origen debe incluir http:// o https://. La variable de entorno DISCOURSE_ENABLE_CORS debe establecerse en true para habilitar CORS.

Propuesta de borrador

Orígenes permitidos para solicitudes entre orígenes (CORS). Cada origen debe incluir http:// o https:// y sin barra final. La variable de entorno DISCOURSE_ENABLE_CORS debe establecerse en true para habilitar CORS.

Por cierto, ¿cómo se haría una PR para algo así? ¿Debería cambiar solo la localización en inglés aquí y las traducciones se gestionarán en otro lugar (por ejemplo, a través de Transifex), o las traducciones también deberían cubrirse en la PR?

2 Me gusta

Si la barra inclinada final es un problema, nuestro código debería eliminarla automáticamente @sam.

6 Me gusta

@vinothkannans ¿puedes cambiarlo para que aquí eliminemos automáticamente la barra diagonal final?

3 Me gusta

Esto ya está solucionado en la PR de abajo

https://github.com/discourse/discourse/pull/10996

4 Me gusta