@wooksjs/http-proxy 0.2.9 → 0.2.11
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/README.md +5 -0
- package/dist/index.cjs +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -110,7 +110,8 @@ const resHeadersToBlock = [
|
|
|
110
110
|
function useProxy() {
|
|
111
111
|
const status = eventHttp.useStatus();
|
|
112
112
|
const { setHeader, headers: getSetHeaders } = eventHttp.useSetHeaders();
|
|
113
|
-
const {
|
|
113
|
+
const { restoreCtx, getCtx } = eventHttp.useHttpContext();
|
|
114
|
+
const { req } = getCtx().event;
|
|
114
115
|
const setHeadersObject = getSetHeaders();
|
|
115
116
|
return function proxy(target, opts) {
|
|
116
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -167,6 +168,7 @@ function useProxy() {
|
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
170
|
}
|
|
171
|
+
restoreCtx();
|
|
170
172
|
return resp;
|
|
171
173
|
});
|
|
172
174
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -108,7 +108,8 @@ const resHeadersToBlock = [
|
|
|
108
108
|
function useProxy() {
|
|
109
109
|
const status = useStatus();
|
|
110
110
|
const { setHeader, headers: getSetHeaders } = useSetHeaders();
|
|
111
|
-
const {
|
|
111
|
+
const { restoreCtx, getCtx } = useHttpContext();
|
|
112
|
+
const { req } = getCtx().event;
|
|
112
113
|
const setHeadersObject = getSetHeaders();
|
|
113
114
|
return function proxy(target, opts) {
|
|
114
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -165,6 +166,7 @@ function useProxy() {
|
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
168
|
}
|
|
169
|
+
restoreCtx();
|
|
168
170
|
return resp;
|
|
169
171
|
});
|
|
170
172
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wooksjs/http-proxy",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "Proxy Wooks composable",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"url": "https://github.com/wooksjs/wooksjs/issues"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@wooksjs/event-http": "0.2.
|
|
34
|
+
"@wooksjs/event-http": "0.2.11"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"node-fetch-native": "^1.0.1"
|