소스 검색

Bugfix: fix typescript issues

master
Fabrice Baumann 5 년 전
부모
커밋
3a67db8891
2개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 1
    1
      package.json
  2. 4
    4
      src/index.ts

+ 1
- 1
package.json 파일 보기

1
 {
1
 {
2
   "name": "excalidraw-room",
2
   "name": "excalidraw-room",
3
-  "version": "1.0.0",
3
+  "version": "1.0.1",
4
   "description": "Excalidraw collaboration server",
4
   "description": "Excalidraw collaboration server",
5
   "main": "index.js",
5
   "main": "index.js",
6
   "scripts": {
6
   "scripts": {

+ 4
- 4
src/index.ts 파일 보기

17
 });
17
 });
18
 
18
 
19
 const io = socketIO(server, {
19
 const io = socketIO(server, {
20
-  handlePreflightRequest: function (req, res) {
20
+  handlePreflightRequest: function (server, req, res) {
21
     var headers = {
21
     var headers = {
22
       "Access-Control-Allow-Headers": "Content-Type, Authorization",
22
       "Access-Control-Allow-Headers": "Content-Type, Authorization",
23
-      "Access-Control-Allow-Origin": req.header ? req.header.origin : "*",
24
-      "Access-Control-Allow-Credentials": true,
23
+      "Access-Control-Allow-Origin": req.headers ? req.headers.origin : "*",
24
+      "Access-Control-Allow-Credentials": "true",
25
     };
25
     };
26
-    res.writeHead(200, headers);
26
+    res.writeHead(200, 'cors', headers);
27
     res.end();
27
     res.end();
28
   },
28
   },
29
 });
29
 });

Loading…
취소
저장