Revert originalArticleUrl change

This commit is contained in:
Hongbo Wu
2022-05-12 10:45:13 +08:00
parent 412d7cebc6
commit 5dca02873d
2 changed files with 1 additions and 6 deletions

View File

@ -45,7 +45,6 @@ import {
import { ContentParseError } from '../../utils/errors'
import {
authorized,
cleanDomainInUrl,
generateSlug,
isParsingTimeout,
pageError,
@ -878,7 +877,7 @@ export const searchResolver = authorized<
isArchived: !!r.archivedAt,
contentReader:
r.pageType === PageType.File ? ContentReader.Pdf : ContentReader.Web,
originalArticleUrl: cleanDomainInUrl(r.url),
originalArticleUrl: r.url,
publishedAt: validatedDate(r.publishedAt),
ownedByViewer: r.userId === claims.uid,
pageType: r.pageType || PageType.Highlights,

View File

@ -230,7 +230,3 @@ export const validatedDate = (
return undefined
}
}
export const cleanDomainInUrl = (url: string): string => {
return url.replace(/^((https?:\/\/)?)(www.)/, (match, p1: string) => p1)
}