Skip to content

Commit

Permalink
fix[frontend]: parsing 's' in expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
SharzyL committed Jun 5, 2024
1 parent 4a5bd23 commit b0cc58e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/index.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ window.addEventListener('DOMContentLoaded', () => {
let customName = '', adminUrl = '', file = null

const NAME_REGEX = /^[a-zA-Z0-9+_\-\[\]*$@,;]{3,}$/
const EXPIRE_REGEX = /^\d+\s*[mhdwM]?$/
const EXPIRE_REGEX = /^\d+\s*[smhdwM]?$/
const submitButton = $('#submit-button')
const deleteButton = $('#delete-button')
const pasteEditArea = $('#paste-textarea')
Expand Down
4 changes: 2 additions & 2 deletions src/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function parsePath(pathname) {
}

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

export function isLegalUrl(url) {
return URL.canParse(url)
}
}
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ async function handleNormalRequest(request, env, ctx) {
throw new WorkerError(405, "method not allowed")
}
}

0 comments on commit b0cc58e

Please sign in to comment.