@jnode/server 2.2.0 → 2.2.1
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/package.json +1 -1
- package/src/handlers.js +5 -6
package/package.json
CHANGED
package/src/handlers.js
CHANGED
|
@@ -220,18 +220,17 @@ class RedirectHandler {
|
|
|
220
220
|
|
|
221
221
|
// prebuild headers
|
|
222
222
|
this._statusCode = this.options.statusCode ?? 307;
|
|
223
|
-
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
handle(ctx, env) {
|
|
226
|
+
ctx.res.writeHead(this._statusCode, {
|
|
224
227
|
'Location': this.options.base ?
|
|
225
228
|
this.options.base +
|
|
226
229
|
(this.options.base.endsWith('/') ? '' : '/') +
|
|
227
230
|
env.path.slice(env.pathPointer).map(encodeURIComponent).join('/') :
|
|
228
231
|
this.location,
|
|
229
232
|
...this.options.headers
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
handle(ctx, env) {
|
|
234
|
-
ctx.res.writeHead(this._statusCode, this._headers);
|
|
233
|
+
});
|
|
235
234
|
ctx.res.end();
|
|
236
235
|
}
|
|
237
236
|
}
|