question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CORS API calls not working with SPDY enabled in chrome

See original GitHub issue

I am using axios for my reactjs project. The backend server for API is hosted on nginx over ssl and has spdy protocol enabled. Does it work with alternate protocols like SPDY?

Chrome is blocking the request with the following error bundle.js:55816 OPTIONS https://axz.in/abc/token net::ERR_SPDY_PROTOCOL_ERROR

Chrome Debug Log as below

t=8819 [st=  0] +REQUEST_ALIVE  [dt=120]
t=8819 [st=  0]   +URL_REQUEST_DELEGATE  [dt=2]
t=8819 [st=  0]      DELEGATE_INFO  [dt=1]
                     --> delegate_info = "extension Adblock Plus"
t=8820 [st=  1]      DELEGATE_INFO  [dt=1]
                     --> delegate_info = "extension AdBlock"
t=8821 [st=  2]   -URL_REQUEST_DELEGATE
t=8821 [st=  2]   +URL_REQUEST_START_JOB  [dt=117]
                   --> load_flags = 34626 (BYPASS_CACHE | DO_NOT_SAVE_COOKIES | DO_NOT_SEND_AUTH_DATA | DO_NOT_SEND_COOKIES | MAYBE_USER_GESTURE | VERIFY_EV_CERT)
                   --> method = "OPTIONS"
                   --> priority = "LOW"
                   --> url = "https://axz.in/abc/token"
t=8821 [st=  2]      URL_REQUEST_DELEGATE  [dt=0]
t=8821 [st=  2]      HTTP_CACHE_GET_BACKEND  [dt=0]
t=8821 [st=  2]      URL_REQUEST_DELEGATE  [dt=0]
t=8821 [st=  2]     +HTTP_STREAM_REQUEST  [dt=0]
t=8821 [st=  2]        HTTP_STREAM_REQUEST_STARTED_JOB
                       --> source_dependency = 474195 (HTTP_STREAM_JOB)
t=8821 [st=  2]        HTTP_STREAM_REQUEST_BOUND_TO_JOB
                       --> source_dependency = 474195 (HTTP_STREAM_JOB)
t=8821 [st=  2]     -HTTP_STREAM_REQUEST
t=8821 [st=  2]     +HTTP_TRANSACTION_SEND_REQUEST  [dt=1]
t=8822 [st=  3]        HTTP_TRANSACTION_HTTP2_SEND_REQUEST_HEADERS
                       --> :host: ayz.in
                           :method: OPTIONS
                           :path: /abc/token
                           :scheme: https
                           :version: HTTP/1.1
                           accept: */*
                           accept-encoding: gzip, deflate, sdch
                           accept-language: en-US,en;q=0.8
                           access-control-request-headers: accept, authorization, content-type
                           access-control-request-method: POST
                           cache-control: no-cache
                           origin: http://localhost:8000
                           pragma: no-cache
                           referer: http://localhost:8000/
                           user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
t=8822 [st=  3]     -HTTP_TRANSACTION_SEND_REQUEST
t=8822 [st=  3]      HTTP_TRANSACTION_READ_HEADERS  [dt=116]
                     --> net_error = -337 (ERR_SPDY_PROTOCOL_ERROR)
t=8938 [st=119]   -URL_REQUEST_START_JOB
                   --> net_error = -337 (ERR_SPDY_PROTOCOL_ERROR)
t=8938 [st=119]    URL_REQUEST_DELEGATE  [dt=0]
t=8939 [st=120] -REQUEST_ALIVE
                 --> net_error = -337 (ERR_SPDY_PROTOCOL_ERROR)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
chuwikcommented, May 31, 2016

Hi @rajchourasia To make sure it’s not a CORS related issue, maybe try opening your website with Chrome with these flags: “–disable-web-security --user-data-dir”. If with this you get it working fine, then you have a problem with CORS 😃

0reactions
WhyIExistcommented, Mar 16, 2019

Did anyone got some solution… I’m badly stuck in same issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

CORS not working on Chrome - Stack Overflow
It seems to be making the request, but without any of the headers you'd expect. If the URL is from the same origin,...
Read more >
Troubleshoot CORS errors from API Gateway - AWS
To resolve a CORS error from an API Gateway REST API or HTTP API, you must reconfigure the API to meet the CORS...
Read more >
I started getting CORS errors after upgrading to v76.
I'm developing a web app that makes web service requests via Axios to an endpoint on one of our development servers. The requests...
Read more >
live-server - npm
Start using live-server in your project by running `npm i live-server`. ... Enables CORS for any origin (reflects request origin, requests ...
Read more >
Firefox CORS - missing "user-agent" in response header ...
I guess the problem is that the response from Moralis API is missing ... On Chrome/Brave it works correctly, but on Firefox I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found