Skip to content

Commit

Permalink
add no-cors mode on fetch options when check for server status
Browse files Browse the repository at this point in the history
relative to: #2 (comment)
  • Loading branch information
kataras committed Jul 1, 2019
1 parent 374700d commit 7384e2d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/neffos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/neffos.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neffos.js",
"version": "0.1.17",
"version": "0.1.18",
"description": "javascript client for the modern neffos websocket framework",
"keywords": [
"neffos",
Expand Down
4 changes: 2 additions & 2 deletions src/neffos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const isBrowser = (typeof window !== 'undefined');
var _fetch = (typeof fetch !== 'undefined') ? fetch : undefined;
if (!isBrowser) {
WebSocket = require('ws');
_fetch = require('node-fetch') as (input: RequestInfo, init?: RequestInit) => Promise<Response>;
_fetch = require('node-fetch');
} else {
WebSocket = window["WebSocket"];
}
Expand Down Expand Up @@ -873,7 +873,7 @@ function whenResourceOnline(endpoint: string, checkEvery: number, notifyOnline:
// counts and sends as header the previous failures (if any) and the succeed last one.
let tries = 1;

const fetchOptions = { method: 'HEAD' };
const fetchOptions = { method: 'HEAD', mode: 'no-cors' };

let check = (): void => {
// Note:
Expand Down

0 comments on commit 7384e2d

Please sign in to comment.