@proveanything/smartlinks 1.8.2 → 1.8.3
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/docs/API_SUMMARY.md +1 -1
- package/dist/http.js +14 -1
- package/docs/API_SUMMARY.md +1 -1
- package/package.json +1 -1
package/dist/docs/API_SUMMARY.md
CHANGED
package/dist/http.js
CHANGED
|
@@ -749,6 +749,19 @@ function serializeFormDataForProxy(fd) {
|
|
|
749
749
|
});
|
|
750
750
|
return { _isFormData: true, entries };
|
|
751
751
|
}
|
|
752
|
+
function sanitizeProxyRequestOptions(options) {
|
|
753
|
+
if (!options)
|
|
754
|
+
return undefined;
|
|
755
|
+
const _a = options, { signal, body, headers, method, window, duplex } = _a, rest = __rest(_a, ["signal", "body", "headers", "method", "window", "duplex"]);
|
|
756
|
+
void signal;
|
|
757
|
+
void body;
|
|
758
|
+
void headers;
|
|
759
|
+
void method;
|
|
760
|
+
void window;
|
|
761
|
+
void duplex;
|
|
762
|
+
const sanitized = Object.fromEntries(Object.entries(rest).filter(([, value]) => value !== undefined));
|
|
763
|
+
return Object.keys(sanitized).length ? sanitized : undefined;
|
|
764
|
+
}
|
|
752
765
|
async function proxyRequest(method, path, body, headers, options) {
|
|
753
766
|
ensureProxyListener();
|
|
754
767
|
const payloadBody = (typeof FormData !== 'undefined' && body instanceof FormData)
|
|
@@ -762,7 +775,7 @@ async function proxyRequest(method, path, body, headers, options) {
|
|
|
762
775
|
path,
|
|
763
776
|
body: payloadBody,
|
|
764
777
|
headers,
|
|
765
|
-
options,
|
|
778
|
+
options: sanitizeProxyRequestOptions(options),
|
|
766
779
|
};
|
|
767
780
|
logDebug('[smartlinks] proxy:postMessage', { id, method, path, headers: headers ? redactHeaders(headers) : undefined, hasBody: !!body });
|
|
768
781
|
return new Promise((resolve, reject) => {
|
package/docs/API_SUMMARY.md
CHANGED