Skip to content
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

fix: include request url and headers in pretty error page #4448

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Nov 15, 2023

What this PR solves / how to test:

This change ensures Miniflare's pretty error page includes the URL and headers of the incoming request, rather than Miniflare's internal request from workerd to the loopback server.

The request URL has been incorrect since the pretty error page was introduced into version 3 (cloudflare/miniflare#436). The request headers have been incorrect since (cloudflare/miniflare#681). This change also adds some tests to prevent this regressing again.

To test, run wrangler dev with a worker that throws an unhandled exception and visit the page in your browser. The reported request URL should match the browser's URL, and the headers should match headers sent by the browser.

Author has addressed the following:

  • Tests
    • Included
    • Not necessary because:
  • Changeset (Changeset guidelines)
    • [x Included
    • Not necessary because:
  • Associated docs
    • Issue(s)/PR(s):
    • Not necessary because: expected behaviour for the pretty error page

Note for PR author:

We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label highlight pr review so future reviewers can take inspiration and learn from it.

This change ensures Miniflare's pretty error page includes the URL and
headers of the incoming request, rather than Miniflare's internal
request from `workerd` to the loopback server.

The request URL has been incorrect since the pretty error page was
introduced into version 3 (cloudflare/miniflare#436). The request
headers have been incorrect since (cloudflare/miniflare#681). This
change also adds some tests to prevent this regressing again.
@mrbbot mrbbot requested a review from a team as a code owner November 15, 2023 14:39
Copy link

changeset-bot bot commented Nov 15, 2023

🦋 Changeset detected

Latest commit: 25c3705

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
miniflare Patch
@cloudflare/pages-shared Patch
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6878782592/npm-package-wrangler-4448

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6878782592/npm-package-wrangler-4448

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6878782592/npm-package-wrangler-4448 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6878782592/npm-package-miniflare-4448
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6878782592/npm-package-cloudflare-pages-shared-4448

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.15.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20231025.1
workerd 1.20231030.0 1.20231030.0
workerd --version 1.20231030.0 2023-10-30

|

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Merging #4448 (25c3705) into main (be36619) will increase coverage by 0.03%.
Report is 1 commits behind head on main.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4448      +/-   ##
==========================================
+ Coverage   75.46%   75.50%   +0.03%     
==========================================
  Files         225      225              
  Lines       12478    12478              
  Branches     3239     3239              
==========================================
+ Hits         9417     9421       +4     
+ Misses       3061     3057       -4     

see 3 files with indirect coverage changes

@mrbbot mrbbot merged commit eb08e2d into main Dec 8, 2023
17 checks passed
@mrbbot mrbbot deleted the bcoll/pretty-error-page-url-headers branch December 8, 2023 10:58
@workers-devprod workers-devprod mentioned this pull request Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants