diff --git a/components/work/WorkDocument.tsx b/components/work/WorkDocument.tsx
index 6c4e16107..16aff2a89 100644
--- a/components/work/WorkDocument.tsx
+++ b/components/work/WorkDocument.tsx
@@ -87,7 +87,7 @@ export const WorkDocument = ({ work, metadata }: WorkDocumentProps) => {
{work.pdfCopyrightAllowsDisplay ? (
setPdfUnavailable(true)}
/>
diff --git a/services/proxy.service.ts b/services/proxy.service.ts
deleted file mode 100644
index 01fc61c7d..000000000
--- a/services/proxy.service.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-const getBaseUrl = (): string => {
- if (process.env.VERCEL_ENV === 'production') {
- return 'https://proxy.prod.researchhub.com';
- }
- return 'https://proxy.staging.researchhub.com';
-};
-
-export const ProxyService = {
- getBaseUrl,
- generateProxyUrl: (url: string): string => {
- // Don't proxy ResearchHub CDN URLs
- if (url && url.includes('researchhub')) {
- return url;
- }
-
- const baseUrl = getBaseUrl();
- return `${baseUrl}/proxy?url=${encodeURIComponent(url)}`;
- },
-};
-
-export default ProxyService;
diff --git a/types/work.ts b/types/work.ts
index a394b537f..81186596c 100644
--- a/types/work.ts
+++ b/types/work.ts
@@ -5,9 +5,7 @@ import { Topic, transformTopic } from './topic';
import { createTransformer, BaseTransformed } from './transformer';
import { Hub } from './hub';
import { NoteWithContent, transformNoteWithContent } from './note';
-import { ProxyService } from '../services/proxy.service';
import { stripHtml } from '../utils/stringUtils';
-import { transformUser, TransformedUser } from './user';
import { transformTip, Tip } from './tip';
import { transformProposalReview, type ProposalReview } from './aiPeerReview';
import type { FundingPool, GrantApplicationVisibility } from './grant';
@@ -74,10 +72,6 @@ export type DocumentVersion = {
export interface FormatType {
type: string;
url: string;
- /**
- * This is a proxied URL for internal use (e.g., to avoid CORS issues when rendering PDFs).
- */
- internalUrl?: string;
}
export interface Work {
@@ -320,21 +314,10 @@ export const transformWork = createTransformer((raw) => {
doi: raw.doi,
journal: transformJournal(raw),
formats: raw.file
- ? [...(raw.formats || []), { type: 'PDF', url: raw.file, internalUrl: raw.file }]
+ ? [...(raw.formats || []), { type: 'PDF', url: raw.file }]
: raw.pdf_url
- ? [
- ...(raw.formats || []),
- {
- type: 'PDF',
- url: raw.pdf_url,
- internalUrl: ProxyService.generateProxyUrl(raw.pdf_url),
- },
- ]
- : (raw.formats || []).map((format: FormatType) => ({
- ...format,
- internalUrl:
- format.type === 'PDF' ? ProxyService.generateProxyUrl(format.url) : undefined,
- })),
+ ? [...(raw.formats || []), { type: 'PDF', url: raw.pdf_url }]
+ : raw.formats || [],
license: raw.pdf_license,
pdfCopyrightAllowsDisplay: raw.pdf_copyright_allows_display,
figures: raw.first_preview