Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Default redirect = follow which is not the same as Cloudflare's runtime #150

@mjhaller

Description

@mjhaller

With a local cloudworker instance, the default value of redirect is "follow":

addEventListener('fetch', event => {
  event.respondWith(new Response(`request.redirect = ${event.request.redirect}`));
})
$ curl http://localhost:9000
request.redirect = follow

With Cloudflare's runtime it is manual

image

It is clear from the docs - https://developers.cloudflare.com/workers/reference/apis/request/ that this should be manual for the request in the fetchEvent.

[...] Note: default for requests generated from the incoming fetchEvent from the event handler is manual.

This of course leads to some very odd behaviors which are hard to track down. Am I missing something? Why is this follow by default?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions