Skip to content

Never follow redirect in the middleware #3552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 13, 2025
Merged

Never follow redirect in the middleware #3552

merged 3 commits into from
Aug 13, 2025

Conversation

conico974
Copy link
Contributor

Configure the middleware to not follow redirects, ensuring that redirects are handled by the client instead.

This was causing 404 for most redirects on the first call after an invalidation in 2C.

Copy link

linear bot commented Aug 11, 2025

Copy link

changeset-bot bot commented Aug 11, 2025

⚠️ No Changeset found

Latest commit: 37103a1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

argos-ci bot commented Aug 11, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2 (Inspect) 👍 Changes approved 34 changed Aug 13, 2025, 10:51 AM
v2-cloudflare (Inspect) 👍 Changes approved 6 changed Aug 13, 2025, 10:55 AM
v2-vercel (Inspect) ✅ No changes detected - Aug 13, 2025, 10:54 AM

Copy link
Contributor

@gregberge gregberge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it fix?

@conico974
Copy link
Contributor Author

What does it fix?

On 2c for redirects from within a page (i.e. not from the middleware), the first ever call could return a 404. This was not necessarily noticeable, as most of them were for background request that would never be accessed. And subsequent request worked just fine.
This caused flakyness for these tests as well
image

@conico974 conico974 merged commit 3500de9 into main Aug 13, 2025
16 checks passed
@conico974 conico974 deleted the conico/rnd-7820-404 branch August 13, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants