Closed lalit-pundir closed 5 years ago
What makes you think CORS settings are not applying to the httpbin mapping?
Other resources not appearing when accessing httpbin from an Ambassador mapping is not due to a CORS issue. If you take a look at the network traffic when accessing the httpbin mapping, you will see multiple failed resource requests. If you inspect one of these requests (let's use jquery.min.js) and take a look at the headers, you will see that the request URL is http://<ambassador-ip>/flasgger_static/%20lib/jquery.min.js
which results in a 404 because it is looking for a resource on your host that does not exist.
The way to avoid this error is to use host_redirect
in the mapping so the host for the jquery.min.js request is httpbin.org:
---
apiVersion: ambassador/v0
kind: Mapping
name: httpbin_mapping
prefix: /httpbin/
host_redirect: true
path_redirect: /
service: httpbin.org:80
host_rewrite: httpbin.org
apiVersion: ambassador/v0 kind: Mapping name: httpbin_mapping prefix: /httpbin/ service: httpbin.org:80 host_rewrite: httpbin.org ambassador_id: ambassador-development
"What makes you think CORS settings are not applying to the httpbin mapping?" Tried adding CORS seting for both internal and external service. I was able to get "Origin not allowed" for internal service , while the same does not give any error in case of external service.
As CORS setting for external service does not seem to have any effect thus we are saying it does not seem to be working with external service
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm also facing this issue with ambassador edge stack, any fixes on this? I tried implementing above config but CORS issue is not getting resolved for external Auth
We have added CORS on module level ->
metadata: name: ambassador namespace: development annotations: getambassador.io/config: |
Which seem to be working fine for internal services like ->
annotations: getambassador.io/config: |
But the same CORS setting are not working when we have mapping for external service ->
metadata: annotations: getambassador.io/config: |
Can you please suggest ....