lookie02
CDCloudflare Developers
•Created by lookie02 on 9/19/2023 in #workers-help
Can't modify immutable headers seen while trying to navigate into different paths of the website
I don't know there are two different status for the same worker ha ha
my subdomain throws 301 redirect and the worker throws 200 status and is working fine
6 replies
CDCloudflare Developers
•Created by lookie02 on 9/19/2023 in #workers-help
Can't modify immutable headers seen while trying to navigate into different paths of the website
6 replies
CDCloudflare Developers
•Created by lookie02 on 9/19/2023 in #workers-help
Can't modify immutable headers seen while trying to navigate into different paths of the website
The issue seems revolved when I run it through the worker site but when I run it through custom domain. It shows 502 bad gateway error. I dont know what is going wrong.
https://myordr-webflow.asterdio-inc2022.workers.dev/ This is my worker site and everything is going right, giving me 200 status. But when I go through the same worker in custom domain. https://worker.myordr.com/. Its not working and 301 redirecting it to the webflow application which i do not want.
6 replies
CDCloudflare Developers
•Created by lookie02 on 9/19/2023 in #workers-help
Can't modify immutable headers seen while trying to navigate into different paths of the website
This is the code snippet
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const url = new URL(request.url)
// Paths that should be routed to Webflow
const webflowPaths = ['/pricing', '/blog', '/products']
if (url.pathname === '/') {
// Serve the Webflow site for the root path
return fetch('https://webflow.application', request)
} else if (webflowPaths.some(path => url.pathname.startsWith(path))) {
// Modify 'host' header to your Webflow site for other Webflow paths
request.headers.set('Host', 'web-flow.application')
return fetch(request)
} else {
// If not a Webflow path, route to your React app
const reactAppUrl = 'https://react.application + url.pathname
return fetch(reactAppUrl, request)
}
}
6 replies
CDCloudflare Developers
•Created by Hermes Alves on 8/30/2023 in #pages-help
Setting Up Custom Domains for Different Branches in Cloudflare Pages
Those sure are. I want to know about those tool too
6 replies