Skip to content

Commit

Permalink
🧹 chore: bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyAom committed Dec 23, 2024
1 parent 9c05ee5 commit 8a1e94f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

# 1.2.0-rc.0 - 23 Dec 2024
Change:
- Add support for Elysia 1.2

# 1.1.2 - 18 Dec 2024
Bug fix:
- [#40](https://github.com/elysiajs/elysia-static/pull/40) serve indexHTML
Expand Down
Binary file modified bun.lockb
Binary file not shown.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@elysiajs/static",
"version": "1.1.2",
"version": "1.2.0",
"license": "MIT",
"scripts": {
"dev": "bun run --hot example/index.ts",
Expand All @@ -24,15 +24,15 @@
"node-cache": "^5.1.2"
},
"devDependencies": {
"@types/bun": "1.1.6",
"@types/bun": "1.1.14",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"elysia": ">= 1.1.0-rc.2",
"elysia": ">= 1.2.0",
"eslint": "9.6.0",
"tsup": "^8.1.0",
"typescript": "^5.5.3"
},
"peerDependencies": {
"elysia": ">= 1.1.0"
"elysia": ">= 1.2.0"
},
"keywords": [
"elysia",
Expand All @@ -51,4 +51,4 @@
"bugs": "https://github.com/elysiajs/elysia-static/issues",
"description": "Plugin for Elysia for serving static folder",
"homepage": "https://github.com/elysiajs/elysia-static"
}
}
11 changes: 6 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,8 @@ export const staticPlugin = async <Prefix extends string = '/prefix'>(
headers['Etag'] = etag
headers['Cache-Control'] = directive
if (maxAge !== null)
headers[
'Cache-Control'
] += `, max-age=${maxAge}`
headers['Cache-Control'] +=
`, max-age=${maxAge}`

return new Response(file, {
headers
Expand All @@ -297,8 +296,10 @@ export const staticPlugin = async <Prefix extends string = '/prefix'>(
`${prefix}/*`,
async ({ params, headers: reqHeaders }) => {
let path = enableDecodeURI
? decodeURI(`${assets}/${decodeURI(params['*'])}`)
: `${assets}/${params['*']}`
? // @ts-ignore
decodeURI(`${assets}/${decodeURI(params['*'])}`)
: // @ts-ignore
`${assets}/${params['*']}`
// Handle varying filepath separators
if (isFSSepUnsafe) {
path = path.replace(URL_PATH_SEP, sep)
Expand Down

0 comments on commit 8a1e94f

Please sign in to comment.