Skip to content

Commit

Permalink
Fix script's content type (#165)
Browse files Browse the repository at this point in the history
* switch inspection chamber script from inline to external

* custom ident encoder

* - logging

* fix content type of chamber script
  • Loading branch information
martrapp authored Aug 15, 2024
1 parent a4b36ad commit b46e61c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/famous-glasses-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro-vtbot': patch
---

Fixes content-type of chamber script
8 changes: 7 additions & 1 deletion integration/astro-inspection-chamber.js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ const inspectionChamber = readFileSync('node_modules/@vtbag/inspection-chamber/l

export async function GET({ params, request }) {
return new Response(
`if (sessionStorage.getItem('vtbot-inspection-chamber') === 'true') {${inspectionChamber}};`
`if (sessionStorage.getItem('vtbot-inspection-chamber') === 'true') {${inspectionChamber}};`, {
status: 200,
headers: {
"Content-Type": "text/javascript"
}
}

);
}

0 comments on commit b46e61c

Please sign in to comment.