Bladeren bron

So an origin doesn't include a path. Well.

Brendan Abolivier 8 jaren geleden
bovenliggende
commit
eaca3b4e59
Getekend door: Brendan Abolivier <contact@brendanabolivier.com> GPG key ID: 8EF1500759F70623
2 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 2
    2
      server.js
  2. 1
    1
      settings.example.json

+ 2
- 2
server.js Bestand weergeven

@@ -32,11 +32,11 @@ app.use(bodyParser.urlencoded({ extended: true }));
32 32
 app.use(bodyParser.json());
33 33
 // Allow cross-origin requests.
34 34
 var corsOptions = {
35
-  origin: settings.formUrl,
35
+  origin: settings.formOrigin,
36 36
   optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204
37 37
 };
38 38
 app.use(cors(corsOptions));
39
-
39
+// Taking care of preflight requests
40 40
 app.options('*', cors(corsOptions));
41 41
 
42 42
 

+ 1
- 1
settings.example.json Bestand weergeven

@@ -13,5 +13,5 @@
13 13
         "you@example.tld",
14 14
         "someone.else@example.com"
15 15
     ],
16
-    "formUrl": "https://example.tld/contact"
16
+    "formOrigin": "https://example.tld"
17 17
 }