Skip to content

Commit

Permalink
Update headers
Browse files Browse the repository at this point in the history
  • Loading branch information
TsayAdobe committed Sep 4, 2024
1 parent 199657d commit e4a65d2
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions edgeworkers/Acrobat_DC_web_prod/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,17 @@ export async function responseProvider(request) {
const acrobat = isProd ? 'https://acrobat.adobe.com' : 'https://stage.acrobat.adobe.com';
const pdfnow = isProd ? 'https://pdfnow.adobe.io' : 'https://pdfnow-stage.adobe.io';
const adobeid = isProd ? 'https://adobeid-na1.services.adobe.com' : 'https://adobeid-na1-stg1.services.adobe.com';
const headers = {
...responseHeaders,
'Content-Security-Policy': csp,
Link: [

let headerLink;
if (mobileWidget && request.device.isMobile) {
headerLink = [
`<${adobeid}>;rel="preconnect"`,
'<https://assets.adobedtm.com>;rel="preconnect"',
'<https://use.typekit.net>;rel="preconnect"',
`</libs/deps/imslib.min.js>;rel="preload";as="script"`,
].join();
} else {
headerLink = [
`<${acrobat}>;rel="preconnect"`,
`<${adobeid}>;rel="preconnect"`,
`<${pdfnow}>;rel="preconnect"`,
Expand All @@ -195,7 +202,13 @@ export async function responseProvider(request) {
`</libs/deps/imslib.min.js>;rel="preload";as="script"`,
`<${acrobat}/dc-core/${dcCoreVersion}/dc-core.js>;rel="preload";as="script"`,
`<${acrobat}/dc-core/${dcCoreVersion}/dc-core.css>;rel="preload";as="style"`,
].join()
].join();
}

const headers = {
...responseHeaders,
'Content-Security-Policy': csp,
Link: headerLink
};

return createResponse(
Expand Down

0 comments on commit e4a65d2

Please sign in to comment.