bttmly / nba

Node.js client for nba.com API endpoints
MIT License
710 stars 180 forks source link

A fix for HTTP being blocked (Mix Content Error) #75

Closed liufud closed 4 years ago

liufud commented 4 years ago

This is more of a suggestion than an issue. If you host your app using HTTPS, and ran into this error in the browser

Mixed Content: The page at 'https://somedevapp.azurewebsites.net/#/managesomething' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://admindevapp.azurewebsites.net/api/data/getdata'. This request has been blocked; the content must be served over HTTPS.

Try adding <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> to the <head> tag in your HTML https://stackoverflow.com/questions/52130918/web-api-error-this-request-has-been-blocked-the-content-must-be-served-over-h

Hope this helps!

bttmly commented 4 years ago

I'm not sure I understand the problem being addressed here? The NBA's API CORS policy generally prohibits you from using this package directly in the browser; as such, browser compatibility is no longer a goal here. This package is primarily intended to be used from Node.js; if it works in the browser, great, but otherwise I'm not too worried about it