Compare commits

...

3 Commits

Author SHA1 Message Date
TheShadowEevee
83246d6a4b fix: increase TLD length regex (#886)
30 matches the Second Level Domain length limit. This should allow for TLDs longer than 2 or 3 characters, such as .solutions

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
2025-09-09 16:50:46 -07:00
diced
ac41dab2b2 fix: title not updating on first-load 2025-09-09 16:19:54 -07:00
diced
26661f7a83 fix: encode id for view route 2025-09-09 16:06:27 -07:00
4 changed files with 4 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ import { createRoutes } from './routes';
export const getFile = async (id: string) =>
prisma.file.findFirst({
where: { name: id as string },
where: { name: decodeURIComponent(id) },
select: {
...fileSelect,
password: true,

View File

@@ -7,7 +7,7 @@ import { useNavigate } from 'react-router-dom';
import { settingsOnSubmit } from '../settingsOnSubmit';
const DOMAIN_REGEX =
/^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,3})$/gim;
/^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,30})$/gim;
export default function Domains({
swr: { data, isLoading },

View File

@@ -10,5 +10,5 @@ export function useTitle(title?: string) {
useEffect(() => {
if (!data || error || isLoading) return;
document.title = title ? `${data.website.title} ${title}` : data.website.title || 'Zipline';
}, [title, location]);
}, [title, location, data, isLoading]);
}

View File

@@ -321,7 +321,7 @@ export default fastifyPlugin(
z
.string()
.regex(
/^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,3})$/gi,
/^[a-zA-Z0-9][a-zA-Z0-9-_]{0,61}[a-zA-Z0-9]{0,1}\.([a-zA-Z]{1,6}|[a-zA-Z0-9-]{1,30}\.[a-zA-Z]{2,30})$/gi,
'Invalid Domain',
),
),