[Answer]-How to avoid Cross-Origin Resource Sharing error when hitting a Django API from another server process?

1👍

CORS is port-sensetive. Specification says that

If there is no port component of the URI:
1.  Let uri-port be the default port for the protocol given by uri-scheme.
Otherwise:
2.  Let uri-port be the port component of the URI.

And

If the two origins are scheme/host/port triples, the two origins are the same if, and only if, they have identical schemes, hosts, and ports.

This means that, with your spec CORS handles your whitelist as localhost:80, 127.0.0.1:80. I believe specifying localhost:3099 should resolve this issue.

👤J0HN

Leave a comment