@adobe/helix-deploy 10.0.1 → 10.1.0
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/DevelopmentServer.js +11 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [10.1.0](https://github.com/adobe/helix-deploy/compare/v10.0.1...v10.1.0) (2024-01-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add support for custom headers ([#640](https://github.com/adobe/helix-deploy/issues/640)) ([a726f7a](https://github.com/adobe/helix-deploy/commit/a726f7a994b9e6c764a107c7f5dde8975adda48f))
|
|
7
|
+
|
|
1
8
|
## [10.0.1](https://github.com/adobe/helix-deploy/compare/v10.0.0...v10.0.1) (2024-01-13)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/DevelopmentServer.js
CHANGED
|
@@ -71,7 +71,7 @@ export default class DevelopmentServer {
|
|
|
71
71
|
this._main = main;
|
|
72
72
|
this._cwd = process.cwd();
|
|
73
73
|
this._port = process.env.WEBSERVER_PORT || 3000;
|
|
74
|
-
this.
|
|
74
|
+
this._headers = {};
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
withPort(value) {
|
|
@@ -80,7 +80,13 @@ export default class DevelopmentServer {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
withXFH(value) {
|
|
83
|
-
|
|
83
|
+
process.emitWarning('DevelopmentServer.withXFH is deprecated. Use withHeader(\'x-forwarded-host\') instead.', 'DeprecationWarning');
|
|
84
|
+
this._headers['x-forwarded-host'] = value;
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
withHeader(name, value) {
|
|
89
|
+
this._headers[name] = value;
|
|
84
90
|
return this;
|
|
85
91
|
}
|
|
86
92
|
|
|
@@ -206,9 +212,9 @@ export default class DevelopmentServer {
|
|
|
206
212
|
}
|
|
207
213
|
});
|
|
208
214
|
this.app.use(rawBody());
|
|
209
|
-
|
|
210
|
-
this.app.use(addRequestHeader(
|
|
211
|
-
}
|
|
215
|
+
Object.entries(this._headers).forEach(([name, value]) => {
|
|
216
|
+
this.app.use(addRequestHeader(name, value.replace('{port}', this._port)));
|
|
217
|
+
});
|
|
212
218
|
this.app.all('*', this._handler);
|
|
213
219
|
}
|
|
214
220
|
|