diff --git a/frontend/index.client.js b/frontend/index.client.js index 0a14213..f5f24ae 100644 --- a/frontend/index.client.js +++ b/frontend/index.client.js @@ -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') diff --git a/src/common.js b/src/common.js index c9cce6f..9f00ff9 100644 --- a/src/common.js +++ b/src/common.js @@ -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`) } @@ -136,4 +136,4 @@ export function getDispFilename(fields) { export function isLegalUrl(url) { return URL.canParse(url) -} \ No newline at end of file +} diff --git a/src/index.js b/src/index.js index b476f22..5f6f765 100644 --- a/src/index.js +++ b/src/index.js @@ -45,4 +45,3 @@ async function handleNormalRequest(request, env, ctx) { throw new WorkerError(405, "method not allowed") } } -