UNPKG

@shopify/shopify-app-react-router

Version:

Shopify React Router - to simplify the building of Shopify Apps with React Router

1 lines 1.1 kB
{"version":3,"file":"respond-to-options-request.mjs","sources":["../../../../../../src/server/authenticate/helpers/respond-to-options-request.ts"],"sourcesContent":["import {BasicParams} from '../../types';\n\nimport {ensureCORSHeadersFactory} from './ensure-cors-headers';\n\nexport function respondToOptionsRequest(\n params: BasicParams,\n request: Request,\n corsHeaders?: string[],\n) {\n if (request.method === 'OPTIONS') {\n const ensureCORSHeaders = ensureCORSHeadersFactory(\n params,\n request,\n corsHeaders,\n );\n\n throw ensureCORSHeaders(\n new Response(null, {\n status: 204,\n headers: {\n 'Access-Control-Max-Age': '7200',\n },\n }),\n );\n }\n}\n"],"names":[],"mappings":";;SAIgB,uBAAuB,CACrC,MAAmB,EACnB,OAAgB,EAChB,WAAsB,EAAA;AAEtB,IAAA,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE;QAChC,MAAM,iBAAiB,GAAG,wBAAwB,CAChD,MAAM,EACN,OAAO,EACP,WAAW,CACZ;AAED,QAAA,MAAM,iBAAiB,CACrB,IAAI,QAAQ,CAAC,IAAI,EAAE;AACjB,YAAA,MAAM,EAAE,GAAG;AACX,YAAA,OAAO,EAAE;AACP,gBAAA,wBAAwB,EAAE,MAAM;AACjC,aAAA;AACF,SAAA,CAAC,CACH;IACH;AACF;;;;"}