@adobe/helix-html-pipeline 6.20.1 → 6.20.3
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 +14 -0
- package/package.json +5 -5
- package/src/steps/set-custom-response-headers.js +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [6.20.3](https://github.com/adobe/helix-html-pipeline/compare/v6.20.2...v6.20.3) (2025-02-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([#825](https://github.com/adobe/helix-html-pipeline/issues/825)) ([dbaf497](https://github.com/adobe/helix-html-pipeline/commit/dbaf4978b69d037b77e26803d6878f780b6d69c2))
|
|
7
|
+
|
|
8
|
+
## [6.20.2](https://github.com/adobe/helix-html-pipeline/compare/v6.20.1...v6.20.2) (2025-02-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* ignore hop-by-hop headers ([#822](https://github.com/adobe/helix-html-pipeline/issues/822)) ([12b8ad9](https://github.com/adobe/helix-html-pipeline/commit/12b8ad929a736fbcbf10652396930f96f57394d3))
|
|
14
|
+
|
|
1
15
|
## [6.20.1](https://github.com/adobe/helix-html-pipeline/compare/v6.20.0...v6.20.1) (2025-02-13)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-html-pipeline",
|
|
3
|
-
"version": "6.20.
|
|
3
|
+
"version": "6.20.3",
|
|
4
4
|
"description": "Helix HTML Pipeline",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@adobe/remark-gridtables": "3.0.9",
|
|
49
49
|
"github-slugger": "2.0.0",
|
|
50
50
|
"hast-util-raw": "9.1.0",
|
|
51
|
-
"hast-util-select": "6.0.
|
|
52
|
-
"hast-util-to-html": "9.0.
|
|
51
|
+
"hast-util-select": "6.0.4",
|
|
52
|
+
"hast-util-to-html": "9.0.5",
|
|
53
53
|
"hast-util-to-string": "3.0.1",
|
|
54
|
-
"hastscript": "9.0.
|
|
54
|
+
"hastscript": "9.0.1",
|
|
55
55
|
"lodash.escape": "4.0.1",
|
|
56
56
|
"mdast-util-to-hast": "13.2.0",
|
|
57
57
|
"mdast-util-to-string": "4.0.0",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"mocha": "11.1.0",
|
|
91
91
|
"mocha-multi-reporters": "1.5.1",
|
|
92
92
|
"mocha-suppress-logs": "0.5.1",
|
|
93
|
-
"semantic-release": "24.2.
|
|
93
|
+
"semantic-release": "24.2.3"
|
|
94
94
|
},
|
|
95
95
|
"lint-staged": {
|
|
96
96
|
"*.js": "eslint",
|
|
@@ -9,6 +9,21 @@
|
|
|
9
9
|
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Hop-by-hop headers (see https://www.freesoft.org/CIE/RFC/2068/143.htm) that should
|
|
15
|
+
* be ignored as custom header.
|
|
16
|
+
*/
|
|
17
|
+
const HOP_BY_HOP_HEADERS = [
|
|
18
|
+
'connection',
|
|
19
|
+
'keep-alive',
|
|
20
|
+
'public',
|
|
21
|
+
'proxy-authenticate',
|
|
22
|
+
'content-encoding',
|
|
23
|
+
'transfer-encoding',
|
|
24
|
+
'upgrade',
|
|
25
|
+
];
|
|
26
|
+
|
|
12
27
|
function cleanupHeaderValue(value) {
|
|
13
28
|
return value
|
|
14
29
|
.replace(/[^\t\u0020-\u007E\u0080-\u00FF]/g, '')
|
|
@@ -57,6 +72,9 @@ function getACAOriginValue(req, value) {
|
|
|
57
72
|
*/
|
|
58
73
|
export default function setCustomResponseHeaders(state, req, res) {
|
|
59
74
|
Object.entries(state.headers.getModifiers(state.info.path)).forEach(([name, value]) => {
|
|
75
|
+
if (HOP_BY_HOP_HEADERS.includes(name)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
60
78
|
// only use `link` header for extensionless pipeline
|
|
61
79
|
if (name !== 'link' || (state.type === 'html' && state.info.selector === '')) {
|
|
62
80
|
let val = cleanupHeaderValue(value);
|