test: fix slugger length check in FetcherMock
This commit is contained in:
parent
4bb8e132f5
commit
0879531478
1 changed files with 4 additions and 2 deletions
|
|
@ -37,11 +37,13 @@ export class FetcherMock extends Fetcher {
|
|||
};
|
||||
|
||||
private readonly slugifyUrl = (url: URL): string => {
|
||||
if (url.href.length > 240) {
|
||||
const slugifiedUrl = slugify(url.href);
|
||||
|
||||
if (slugifiedUrl.length > 249) {
|
||||
return slugify(`${url.origin}-${crypto.createHash('md5').update(url.href).digest('hex')}`);
|
||||
}
|
||||
|
||||
return slugify(url.href);
|
||||
return slugifiedUrl;
|
||||
};
|
||||
|
||||
private readonly fetch = async (path: string, ctx: Context, url: URL, init?: RequestInit): Promise<string> => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue