I'm trying to get my Angular 2 application running and everything is going relatively smoothly until I hit the API for some data.
Apache is responding with a 301 redirect when Angular's http module does that OPTIONS request, see headers:
Request:
OPTIONS http://api.mydomain.com/register/
Host: api.mydomain.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type
Origin: http://app.mydomain.com
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Response:
Connection: Keep-Alive
Content-Length: 341
Content-Type: text/html; charset=iso-8859-1
Date: Wed, 18 May 2016 18:35:02 GMT
Keep-Alive: timeout=5, max=100
Location: http://api.mydomain.com/register
Server: Apache/2.4.7 (Ubuntu)
Honestly I'm new to Angular and CORS so I'm hoping I just made a nooby mistake. Thanks for your help!
0 Answers