quarks
quarks

Reputation: 35316

What are the causes of HTTP GET (Cancelled)

My app needs to access a resources as in the Request URL however I can see in the Chrome network console that the request is GET (Cancelled)

Request URL:http://localhost:6001/_api/
Request Headers CAUTION: Provisional headers are shown.
Accept:application/json, text/javascript, */*; q=0.01
Cache-Control:max-age=0
Origin:http://127.0.0.1:6001
Referer:http://127.0.0.1:6001/
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/33.0.1750.152 Chrome/33.0.1750.152 Safari/537.36

Is there anything wrong in the request? If I access the Request URL and paste it in the browser, the JSON string is returned properly. What could be the reason?

Update:

Prior to the request above here there is a request for this:

Request URL:http://localhost:6001/_api/_session
Request Method:OPTIONS
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Access-Control-Request-Headers:accept
Access-Control-Request-Method:DELETE
Cache-Control:max-age=0
Connection:keep-alive
Host:localhost:6001
Origin:http://127.0.0.1:6001
Referer:http://127.0.0.1:6001/
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/33.0.1750.152 Chrome/33.0.1750.152 Safari/537.36
Response Headersview source
access-control-allow-headers:Authorization, Content-Type, If-None-Match
access-control-allow-methods:GET, HEAD, POST, PUT, DELETE, OPTIONS
access-control-allow-origin:*
access-control-expose-headers:WWW-Authenticate, Server-Authorization
access-control-max-age:86400
cache-control:no-cache
Connection:keep-alive
content-encoding:gzip
content-type:application/json; charset=utf-8
Date:Sun, 06 Apr 2014 04:26:37 GMT
Transfer-Encoding:chunked
vary:accept-encoding

But the status was: A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://127.0.0.1:6001' is therefore not allowed access.

Upvotes: 0

Views: 436

Answers (1)

Victory
Victory

Reputation: 5890

You are mixing 127.0.0.1 and localhost which could make it look like xss. Use one or the other but not both.

Upvotes: 2

Related Questions