Skip to content

Commit

Permalink
fix: tag asset type when sending hint headers
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsadhu committed Sep 20, 2024
1 parent 3a715d4 commit 56c8614
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions lib/podlet.js
Original file line number Diff line number Diff line change
Expand Up @@ -935,11 +935,15 @@ export default class PodiumPodlet {
await this.httpProxy.process(incoming);
}

// @ts-ignore
const js = incoming.js.map((asset) => asset.toHeader());
const js = incoming.js.map(
// @ts-ignore
(asset) => asset.toHeader() + '; asset-type=script',
);

// @ts-ignore
const css = incoming.css.map((asset) => asset.toHeader());
const css = incoming.css.map(
// @ts-ignore
(asset) => asset.toHeader() + '; asset-type=style',
);

// Send early hints to layout client in the form of a 103 status code and a link header with js/css asset information.
// Always send this. If no assets present, send an empty string.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@metrics/client": "2.5.3",
"@podium/proxy": "5.0.24",
"@podium/schemas": "5.0.6",
"@podium/utils": "5.2.0",
"@podium/utils": "5.2.1",
"abslog": "2.4.4",
"ajv": "8.17.1",
"objobj": "1.0.0"
Expand Down

0 comments on commit 56c8614

Please sign in to comment.