MCPcopy Create free account
hub / github.com/PRX/Infrastructure / handler

Function handler

etc/auto-redirect/index.mjs:52–60  ·  view source on GitHub ↗
(event, context)

Source from the content-addressed store, hash-verified

50 * Response: 301 https://www.new-domain.com/path/to/include/in/redirect
51 */
52export const handler = async (event, context) => ({
53 statusCode: event.rawPath.substring(1, 4),
54 headers: {
55 location: `https://${
56 decodeURIComponent(event.pathParameters.proxy).split('______')[0]
57 }${event.rawQueryString?.length ? `?${event.rawQueryString}` : ''}`,
58 'x-prx-id': context.awsRequestId,
59 },
60});

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected