fix: forward Location header (relative redirect / -> /nubes-test/) + bump 0.0.5
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "tf-docs",
|
"name": "tf-docs",
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"description": "Terraform docs reverse-proxy (stream from VM static server)",
|
"description": "Terraform docs reverse-proxy (stream from VM static server)",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const UPSTREAM_BASE_PATH = UPSTREAM.pathname.replace(/\/+$/, '');
|
|||||||
const UPSTREAM_PORT = UPSTREAM.port || (UPSTREAM.protocol === 'https:' ? 443 : 80);
|
const UPSTREAM_PORT = UPSTREAM.port || (UPSTREAM.protocol === 'https:' ? 443 : 80);
|
||||||
|
|
||||||
const STAND_RE = /^[A-Za-z0-9._-]+$/;
|
const STAND_RE = /^[A-Za-z0-9._-]+$/;
|
||||||
const FORWARD_HEADERS = ['content-type', 'content-length', 'cache-control', 'content-encoding'];
|
const FORWARD_HEADERS = ['content-type', 'content-length', 'cache-control', 'content-encoding', 'location'];
|
||||||
|
|
||||||
function respond(res, status, body) {
|
function respond(res, status, body) {
|
||||||
if (!res.headersSent) {
|
if (!res.headersSent) {
|
||||||
|
|||||||
Reference in New Issue
Block a user