
16/12/2019, 09:10
|
 | | | Fecha de Ingreso: agosto-2014
Mensajes: 147
Antigüedad: 10 años, 6 meses Puntos: 0 | |
Respuesta: Error con CORS en API REST Cita:
Iniciado por prueba230683 En el código del primer post:
Código Java:
Ver original.header("Access-Control-Allow-Headers: 'application/json'", "origin, content-type, accept, authorization")
creo que debería ser:
Código Java:
Ver original.header("Access-Control-Allow-Headers", "origin, content-type, accept, authorization")

Gracias por la respuesta, acabo de probar eso y sigue sin funcionar :( da el mismo error de CORS
Código:
Access to XMLHttpRequest at 'http://192.168.38.7:8080/rest2/webresources/login' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
core.js:6014 ERROR
Código:
zone-evergreen.js:2952 Cross-Origin Read Blocking (CORB) blocked cross-origin response http://192.168.38.137:8080/rest2/webresources/login with MIME type application/vnd.sun.wadl+xml. See https://www.chromestatus.com/feature/5629709824032768 for more details.
|