@base44-preview/sdk 0.8.4-pr.51.71041fc → 0.8.4-pr.53.42553d8
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/client.js +7 -0
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -172,6 +172,7 @@ export function createClientFromRequest(request) {
|
|
|
172
172
|
const appId = request.headers.get("Base44-App-Id");
|
|
173
173
|
const serverUrlHeader = request.headers.get("Base44-Api-Url");
|
|
174
174
|
const functionsVersion = request.headers.get("Base44-Functions-Version");
|
|
175
|
+
const stateHeader = request.headers.get("Base44-State");
|
|
175
176
|
if (!appId) {
|
|
176
177
|
throw new Error("Base44-App-Id header is required, but is was not found on the request");
|
|
177
178
|
}
|
|
@@ -194,11 +195,17 @@ export function createClientFromRequest(request) {
|
|
|
194
195
|
}
|
|
195
196
|
userToken = authHeader.split(" ")[1];
|
|
196
197
|
}
|
|
198
|
+
// Prepare additional headers to propagate
|
|
199
|
+
const additionalHeaders = {};
|
|
200
|
+
if (stateHeader) {
|
|
201
|
+
additionalHeaders["Base44-State"] = stateHeader;
|
|
202
|
+
}
|
|
197
203
|
return createClient({
|
|
198
204
|
serverUrl: serverUrlHeader || "https://base44.app",
|
|
199
205
|
appId,
|
|
200
206
|
token: userToken,
|
|
201
207
|
serviceToken: serviceRoleToken,
|
|
202
208
|
functionsVersion: functionsVersion !== null && functionsVersion !== void 0 ? functionsVersion : undefined,
|
|
209
|
+
headers: additionalHeaders,
|
|
203
210
|
});
|
|
204
211
|
}
|