@niledatabase/server 4.0.0-alpha.20 → 4.0.0-alpha.21
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.
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -91,13 +91,18 @@ async function request(url, _init, config) {
|
|
|
91
91
|
}
|
|
92
92
|
updatedHeaders.set("host", requestUrl.host);
|
|
93
93
|
if (config.api.callbackUrl) {
|
|
94
|
-
|
|
94
|
+
const cbUrl = new URL(config.api.callbackUrl);
|
|
95
|
+
debug(
|
|
96
|
+
`Obtained origin from config.api.callbackUrl ${config.api.callbackUrl}`
|
|
97
|
+
);
|
|
98
|
+
updatedHeaders.set(X_NILE_ORIGIN, cbUrl.origin);
|
|
95
99
|
} else if (config.api.origin) {
|
|
100
|
+
debug(`Obtained origin from config.api.origin ${config.api.origin}`);
|
|
96
101
|
updatedHeaders.set(X_NILE_ORIGIN, config.api.origin);
|
|
97
102
|
} else {
|
|
98
103
|
updatedHeaders.set(X_NILE_ORIGIN, requestUrl.origin);
|
|
104
|
+
debug(`Obtained origin from request ${requestUrl.origin}`);
|
|
99
105
|
}
|
|
100
|
-
debug(`Using origin ${updatedHeaders.get(X_NILE_ORIGIN)}`);
|
|
101
106
|
const params = { ...init, headers: updatedHeaders };
|
|
102
107
|
if (params.method === "POST" || params.method === "PUT") {
|
|
103
108
|
try {
|