Skip to content

Commit b0cc58e

Browse files
committed
fix[frontend]: parsing 's' in expiration
1 parent 4a5bd23 commit b0cc58e

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

frontend/index.client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ window.addEventListener('DOMContentLoaded', () => {
6868
let customName = '', adminUrl = '', file = null
6969

7070
const NAME_REGEX = /^[a-zA-Z0-9+_\-\[\]*$@,;]{3,}$/
71-
const EXPIRE_REGEX = /^\d+\s*[mhdwM]?$/
71+
const EXPIRE_REGEX = /^\d+\s*[smhdwM]?$/
7272
const submitButton = $('#submit-button')
7373
const deleteButton = $('#delete-button')
7474
const pasteEditArea = $('#paste-textarea')

src/common.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function parsePath(pathname) {
7575
}
7676

7777
export function parseExpiration(expirationStr) {
78-
const EXPIRE_REGEX = /^[\d\.]+\s*[mhdwM]?$/
78+
const EXPIRE_REGEX = /^[\d\.]+\s*[smhdwM]?$/
7979
if (!EXPIRE_REGEX.test(expirationStr)) {
8080
throw new WorkerError(400, `‘${expirationStr}’ is not a valid expiration specification`)
8181
}
@@ -136,4 +136,4 @@ export function getDispFilename(fields) {
136136

137137
export function isLegalUrl(url) {
138138
return URL.canParse(url)
139-
}
139+
}

src/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ async function handleNormalRequest(request, env, ctx) {
4545
throw new WorkerError(405, "method not allowed")
4646
}
4747
}
48-

0 commit comments

Comments
 (0)