@x-9lab/xlab 1.0.9 → 1.0.10
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.
|
@@ -98,6 +98,7 @@ async function filter(ctx, next) {
|
|
|
98
98
|
var parsedUrl = _url.default.parse(ctx.url);
|
|
99
99
|
var pathname = parsedUrl.pathname;
|
|
100
100
|
ctx.state.parsedUrl = parsedUrl;
|
|
101
|
+
ctx.state.originHost = ctx.headers["x-forwarded-host"] || ctx.headers.host;
|
|
101
102
|
var srcType = {
|
|
102
103
|
"js": false,
|
|
103
104
|
"html": false,
|
|
@@ -114,14 +115,12 @@ async function filter(ctx, next) {
|
|
|
114
115
|
// 提取页面必要的信息
|
|
115
116
|
// 由于 dir 也可能直接返回 HTML 页面
|
|
116
117
|
// 所以这里也需要经过 HTML 的过滤器处理
|
|
117
|
-
ctx.state.originHost = ctx.headers["x-forwarded-host"] || ctx.headers.host;
|
|
118
118
|
ctx.state.ver = (0, _htmlFilter.filter)(ctx.url);
|
|
119
119
|
} else if (isStatic(pathname)) {
|
|
120
120
|
srcType.static = true;
|
|
121
121
|
if (isHtml(pathname)) {
|
|
122
122
|
srcType.html = true;
|
|
123
123
|
// 提取页面必要的信息
|
|
124
|
-
ctx.state.originHost = ctx.headers["x-forwarded-host"] || ctx.headers.host;
|
|
125
124
|
ctx.state.ver = (0, _htmlFilter.filter)(ctx.url);
|
|
126
125
|
} else if (isJS(pathname)) {
|
|
127
126
|
srcType.js = true;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-9lab/xlab",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "9lab 服务端模块",
|
|
5
|
-
"versionDesc": "
|
|
5
|
+
"versionDesc": "originHost 现在所有请求都会带上",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "swc src -D ./src/bin --config-file .swcrc -d dist -w",
|
|
8
8
|
"compile": "swc src -D ./src/bin --config-file .swcrc -d dist",
|