slimlime / hacker-news-search-client-hn-algolia-angular-paginator

Hacker News search client mini demo -- public repo~!
1 stars 1 forks source link

Deployed http requests CORS XHR errors #21

Closed slimlime closed 6 years ago

slimlime commented 6 years ago

Oops! Reference: https://slimlime.github.io/hacker-news-search-client-hn-algolia-angular-paginator/news-reader Commit gh-pages slimlime@35c96f258eefb9aa23003dd6fd14090beb9da011

Mixed Content: The page at 'https://slimlime.github.io/hacker-news-search-client-hn-algolia-angular-paginator/news-reader' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://hn.algolia.com/api/v1/search?query=Deep%20Learning'. This request has been blocked; the content must be served over HTTPS

main.20bbe49420b9dfb3d961.js:1 ERROR terror: ProgressEvent {isTrusted: true, lengthComputable: false, loaded: 0, total: 0, type: "error", …}bubbles: falsecancelBubble: falsecancelable: falsecomposed: falsecurrentTarget: XMLHttpRequest {readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, responseURL: "", …}defaultPrevented: falseeventPhase: 0isTrusted: truelengthComputable: falseloaded: 0path: []returnValue: truesrcElement: XMLHttpRequest {readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, responseURL: "", …}target: XMLHttpRequest {readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, responseURL: "", …}timeStamp: 289.69999999389984total: 0type: "error"proto: ProgressEventheaders: e {normalizedNames: Map(0), lazyUpdate: null, headers: Map(0)}headers: Map(0) {}lazyUpdate: nullnormalizedNames: Map(0) {}proto: Objectmessage: "Http failure response for (unknown url): 0 Unknown Error"name: "HttpErrorResponse"ok: falsestatus: 0statusText: "Unknown Error"url: nullproto: Object bt @ main.20bbe49420b9dfb3d961.js:1 10:17:49.602 main.20bbe49420b9dfb3d961.js:1 ERROR terror: ProgressEventbubbles: falsecancelBubble: falsecancelable: falsecomposed: falsecurrentTarget: XMLHttpRequest {zone_symbolxhrSync: false, zone_symbolxhrURL: "http://hn.algolia.com/api/v1/search?query=Deep%20Learning", zone_symbolloadfalse: null, zone_symbolerrorfalse: null, zone_symbolxhrListener: ƒ, …}defaultPrevented: falseeventPhase: 0isTrusted: truelengthComputable: falseloaded: 0path: []returnValue: truesrcElement: XMLHttpRequest {zone_symbolxhrSync: false, zone_symbolxhrURL: "http://hn.algolia.com/api/v1/search?query=Deep%20Learning", zone_symbolloadfalse: null, zone_symbolerrorfalse: null, zone_symbolxhrListener: ƒ, …}target: XMLHttpRequest {zone_symbolxhrSync: false, zone_symbolxhrURL: "http://hn.algolia.com/api/v1/search?query=Deep%20Learning", zone_symbolloadfalse: null, zone_symbolerrorfalse: null, __zone_symbolxhrListener: ƒ, …}timeStamp: 291.2999999971362total: 0type: "error"proto: ProgressEventheaders: e {normalizedNames: Map(0), lazyUpdate: null, headers: Map(0)}message: "Http failure response for (unknown url): 0 Unknown Error"name: "HttpErrorResponse"ok: falsestatus: 0statusText: "Unknown Error"url: nullproto__: Object bt @ main.20bbe49420b9dfb3d961.js:1 10:17:50.470

slimlime commented 6 years ago

"It works on my machine" 🤣

slimlime commented 6 years ago

This https://github.com/slimlime/hacker-news-search-client-hn-algolia-angular-paginator/commit/d74210e28defb06181aea0d99341f7e754631fff and https://github.com/slimlime/hacker-news-search-client-hn-algolia-angular-paginator/commit/b806d6c43de6ae845622436c508161d750d6e48c https and deploy config seems to fix the CORS issue on gh-pages hn-algolia REST API