@cappitolian/http-local-server-swifter 0.0.31 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -295,7 +295,7 @@ public class HttpLocalServerSwifter {
|
|
|
295
295
|
response.addHeader("Access-Control-Allow-Origin", "*");
|
|
296
296
|
response.addHeader("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, OPTIONS");
|
|
297
297
|
response.addHeader("Access-Control-Allow-Headers",
|
|
298
|
-
"Origin, Content-Type, Accept, Authorization, X-Requested-With");
|
|
298
|
+
"Origin, Content-Type, Accept, Authorization, X-Requested-With, x-api-key");
|
|
299
299
|
response.addHeader("Access-Control-Max-Age", "3600");
|
|
300
300
|
// Prevents TCP connection reuse. NanoHTTPD does not handle keep-alive
|
|
301
301
|
// correctly under rapid sequential requests, causing ERR_INVALID_HTTP_RESPONSE.
|
|
@@ -186,7 +186,7 @@ public protocol HttpLocalServerSwifterDelegate: AnyObject {
|
|
|
186
186
|
"Content-Type": "application/json",
|
|
187
187
|
"Access-Control-Allow-Origin": "*",
|
|
188
188
|
"Access-Control-Allow-Methods": "GET, POST, PUT, PATCH, DELETE, OPTIONS",
|
|
189
|
-
"Access-Control-Allow-Headers": "Origin, Content-Type, Accept, Authorization, X-Requested-With"
|
|
189
|
+
"Access-Control-Allow-Headers": "Origin, Content-Type, Accept, Authorization, X-Requested-With, x-api-key"
|
|
190
190
|
]
|
|
191
191
|
|
|
192
192
|
if
|
|
@@ -210,7 +210,7 @@ public protocol HttpLocalServerSwifterDelegate: AnyObject {
|
|
|
210
210
|
return .raw(204, "No Content", [
|
|
211
211
|
"Access-Control-Allow-Origin": "*",
|
|
212
212
|
"Access-Control-Allow-Methods": "GET, POST, PUT, PATCH, DELETE, OPTIONS",
|
|
213
|
-
"Access-Control-Allow-Headers": "Origin, Content-Type, Accept, Authorization, X-Requested-With",
|
|
213
|
+
"Access-Control-Allow-Headers": "Origin, Content-Type, Accept, Authorization, X-Requested-With, x-api-key",
|
|
214
214
|
"Access-Control-Max-Age": "86400"
|
|
215
215
|
], nil)
|
|
216
216
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cappitolian/http-local-server-swifter",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"description": "Runs a local HTTP server on your device, accessible over LAN. Supports connect, disconnect, GET, and POST methods with IP and port discovery.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|