Commit 641a461 1 parent d3cdb5c commit 641a461 Copy full SHA for 641a461
File tree 3 files changed +3
-3
lines changed
src/runtime/server/api/_hub/cache
3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export default eventHandler(async (event) => {
9
9
requireNuxtHubFeature ( 'cache' )
10
10
11
11
const key = getRouterParam ( event , 'key' ) || ''
12
- if ( ! / \. ( [ a - z 0 - 9 ] + ) $ / i. test ( key ) ) {
12
+ if ( ! / \. [ a - z 0 - 9 ] + $ / i. test ( key ) ) {
13
13
throw createError ( {
14
14
statusCode : 400 ,
15
15
message : 'Invalid key'
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export default eventHandler(async (event) => {
11
11
12
12
const key = getRouterParam ( event , 'key' ) || ''
13
13
// If ends with an extension
14
- if ( / \. ( [ a - z 0 - 9 ] + ) $ / i. test ( key ) ) {
14
+ if ( / \. [ a - z 0 - 9 ] + $ / i. test ( key ) ) {
15
15
return await useStorage ( 'cache:nitro' ) . getItem ( key )
16
16
}
17
17
const storage = useStorage ( `cache:nitro:${ key } ` )
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export default eventHandler(async (event) => {
9
9
requireNuxtHubFeature ( 'cache' )
10
10
11
11
const base = getRouterParam ( event , 'base' ) || ''
12
- if ( / \. ( [ a - z 0 - 9 ] + ) $ / i. test ( base ) ) {
12
+ if ( / \. [ a - z 0 - 9 ] + $ / i. test ( base ) ) {
13
13
throw createError ( {
14
14
statusCode : 400 ,
15
15
message : 'Invalid base'
You can’t perform that action at this time.
0 commit comments