Skip to content

make dev /cdn-cgi/image behaves like prod for consistency#1147

Merged
vicb merged 1 commit intomainfrom
vicb/cdn-cgi-images
Feb 24, 2026
Merged

make dev /cdn-cgi/image behaves like prod for consistency#1147
vicb merged 1 commit intomainfrom
vicb/cdn-cgi-images

Conversation

@vicb
Copy link
Copy Markdown
Contributor

@vicb vicb commented Feb 24, 2026

This change makes sure the prod XP will match dev XP

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 24, 2026

⚠️ No Changeset found

Latest commit: a3a4c24

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 24, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@opennextjs/cloudflare@1147

commit: a3a4c24

Copy link
Copy Markdown
Contributor

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

Looks good to me

I think that some additional ideas to make this more robust if we would want to would be:

  • since we only want to handle the endpoint locally, check the host itself and make sure that it's localhost/loopback, we already do this sort of thing anyways (
    const protocol = host.includes("localhost") ? "http" : "https";
    )
  • check the raw url before passing it to new URL to make sure that it does contain /cdn-cgi/image/

But they might not be necessary

@vicb vicb merged commit f5bd138 into main Feb 24, 2026
7 checks passed
@vicb vicb deleted the vicb/cdn-cgi-images branch February 24, 2026 14:07
vicb added a commit that referenced this pull request Feb 24, 2026
vicb added a commit that referenced this pull request Feb 24, 2026
conico974 added a commit to opennextjs/adapters-api that referenced this pull request Mar 21, 2026
opennextjs/opennextjs-cloudflare#1147

make dev /cdn-cgi/image behaves like prod for consistency

Changeset: .changeset/port-pr-1147.md
conico974 added a commit to opennextjs/adapters-api that referenced this pull request Mar 29, 2026
* Add SKILL.md for porting PRs and AGENTS.md for coding guidelines

* update skill

* Port opennextjs/opennextjs-aws#1118 as a test

* Port opennextjs/opennextjs-aws#1117

* update skill

* Port opennextjs/opennextjs-aws#1114

* Port PR opennextjs/opennextjs-aws#1107

* update skills

* Port PR opennextjs/opennextjs-aws#1108

* Port PR opennextjs/opennextjs-aws#1104

* Port PR opennextjs/opennextjs-aws#1101

* Port PR opennextjs/opennextjs-aws#1098

* chore: port PR #1083 from source repository

opennextjs/opennextjs-cloudflare#1083

Changeset: .changeset/port-pr-1083.md

* chore: port PR #1105 from source repository

opennextjs/opennextjs-cloudflare#1105

Changeset: .changeset/port-pr-1105.md

* chore: port PR #1097 from source repository

opennextjs/opennextjs-cloudflare#1097

Changeset: .changeset/port-pr-1097.md

* chore: port PR #1122 from source repository

opennextjs/opennextjs-cloudflare#1122

Applied bugfixes and improvements to the 'migrate' command:
- Fixed extra newlines when appending to files (updated conditionalAppendFileSync signature)
- Fixed error when 'public' directory is missing (creates parent directories automatically)
- Fixed Next.js config file update to check if the file exists first
- Updated checkRunningInsideNextjsApp to accept { appPath: string } instead of full BuildOptions

Changesets:
- .changeset/port-pr-1122-cloudflare.md
- .changeset/port-pr-1122-aws.md

* chore: update port PR skill instructions for staging and committing changes

* chore: port PR #1126 from source repository

opennextjs/opennextjs-cloudflare#1126

Fix: prevent Worker hang on HEAD requests to static assets

When run_worker_first is enabled, HEAD requests to static assets hang
the Worker because response.body is null (per HTTP spec) and the
fallback new ReadableStream() creates a stream that never closes.

Changes:
- Return null body for HEAD requests instead of falling through to
the hanging ReadableStream fallback
- Add tests for maybeGetAssetResult covering GET, HEAD, 404, POST,
and run_worker_first=false cases

Changeset: .changeset/port-pr-1126.md

* linting

* chore: port PR #1127 from source repository

opennextjs/opennextjs-cloudflare#1127

Changeset: .changeset/port-pr-1127.md

* chore: port PR #1138 from source repository

opennextjs/opennextjs-cloudflare#1138

Changeset: .changeset/port-pr-1138.md

* chore: port PR #1133 from source repository

opennextjs/opennextjs-cloudflare#1133

Changeset: .changeset/port-pr-1133.md

Update the migrate command to attempt to create an R2 bucket for caching
as part of the migration process, if that is not possible an application
without caching enabled will be generated instead.

* chore: port PR #1142 from source repository

opennextjs/opennextjs-cloudflare#1142

Changeset: .changeset/port-pr-1142.md

* chore: port PR #1147 from source repository

opennextjs/opennextjs-cloudflare#1147

make dev /cdn-cgi/image behaves like prod for consistency

Changeset: .changeset/port-pr-1147.md

* chore: port PR #1150 from source repository

opennextjs/opennextjs-cloudflare#1150

Changeset: .changeset/port-pr-1150.md

* fix lockfile

* fix test
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