Fixed allowed path regex
This commit is contained in:
parent
f29e06254d
commit
ba108193ec
|
@ -18,7 +18,7 @@ export async function processRequest(
|
||||||
const file = params.length > 2 ? params.slice(2).join("/") : "all";
|
const file = params.length > 2 ? params.slice(2).join("/") : "all";
|
||||||
const path =
|
const path =
|
||||||
`https://code.thunderk.net/typescript/${lib}/raw/${version}/${file}.ts`;
|
`https://code.thunderk.net/typescript/${lib}/raw/${version}/${file}.ts`;
|
||||||
if (!path.match(/^[a-z0-9\/\.\:-_]+$/)) {
|
if (!path.match(/^[a-z0-9\/\.\-:_]+$/)) {
|
||||||
return {
|
return {
|
||||||
status: 400,
|
status: 400,
|
||||||
body: `console.error("bundler error - Invalid path ${path}");`,
|
body: `console.error("bundler error - Invalid path ${path}");`,
|
||||||
|
|
Loading…
Reference in a new issue