Skip to content

Conversation

@ben-fornefeld
Copy link
Member

This PR resolves the Cloudflare IP blocking issue by:

  1. Adding www prefix to landing page hostname
  2. Properly handling request headers with new Headers object
  3. Adding redirect handling to follow redirects
  4. Refactoring middleware response handling for proper URL rewriting

These changes prevent Cloudflare from identifying our requests as suspicious automated traffic while maintaining the functionality of our proxy middleware.

…onse + prefix landing page hostname with www

Simplify fetch

Remove headers

Add rest of headers

Explicitly define fetch options

Remove header manipulation

Test all custom config

Remove out cache header

Remove no cache in header

Remove cache

Tweak fetch options

Remove credentials

Remove referrer

Return to basic setup

Add redirect handling

Stop caching

Remove redirect

Remove no cache

Return old settings

Proxy everything

Modify hostname

Change domain

Change hostname back

Remove caching

Change rewrite mechanism

Add more headers

Remove the rewrite

Follow redirect

Try www

Add log

Try just rewrite

Only pass get requests

Fix error

Change headers passing

Print headers

Test pure rewrite

Remove unused code

Add html replace for ai agents list

Remove logs
@ben-fornefeld ben-fornefeld added the bug Something isn't working label Mar 23, 2025
@ben-fornefeld ben-fornefeld self-assigned this Mar 23, 2025
@ben-fornefeld ben-fornefeld requested a review from jakubno as a code owner March 23, 2025 11:31
@changeset-bot
Copy link

changeset-bot bot commented Mar 23, 2025

⚠️ No Changeset found

Latest commit: 5ee3714

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

@ben-fornefeld ben-fornefeld requested review from mlejva and removed request for jakubno March 23, 2025 11:31
@ben-fornefeld ben-fornefeld merged commit c4129d8 into main Mar 23, 2025
5 checks passed
@ben-fornefeld ben-fornefeld deleted the cf-middleware-rewrite-fix branch March 23, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants