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(middleware): respect host protocol #611

Merged
merged 2 commits into from
Oct 30, 2024
Merged

fix(middleware): respect host protocol #611

merged 2 commits into from
Oct 30, 2024

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Oct 30, 2024

The middleware handler default to https and it's causing troubles with the cloudflare dev server (wrangler dev) which uses http by default.

It is possible to force wrangler dev to use https (--local-protocol https) but the browser then shows a warning because the dev certificate is not secure.

Copy link

changeset-bot bot commented Oct 30, 2024

⚠️ No Changeset found

Latest commit: 6ebf8f1

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
Contributor

github-actions bot commented Oct 30, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 19.33% 1410 / 7291
🔵 Statements 19.33% 1410 / 7291
🔵 Functions 53.14% 93 / 175
🔵 Branches 67.27% 333 / 495
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/open-next/src/core/routing/middleware.ts 96.89% 84.84% 50% 96.89% 34, 36-37, 117
Generated in workflow #673 for commit 6ebf8f1 by the Vitest Coverage Report Action

@vicb
Copy link
Contributor Author

vicb commented Oct 30, 2024

@conico974 I have only update the middleware as I'm not sure if we will use the edge-adapter.

@vicb vicb requested a review from conico974 October 30, 2024 14:29
Copy link

pkg-pr-new bot commented Oct 30, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/aws@611

commit: 6ebf8f1

Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

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

What's the issue with the edge-adapter ?

packages/open-next/src/core/routing/middleware.ts Outdated Show resolved Hide resolved
- fix code
- add tests
- minor cleanups in code + tests
@vicb vicb force-pushed the vb-branch-4 branch 4 times, most recently from a46d45a to 6ebf8f1 Compare October 30, 2024 16:21
@vicb vicb requested a review from conico974 October 30, 2024 16:23
@vicb
Copy link
Contributor Author

vicb commented Oct 30, 2024

@conico974 PTAL and let me know if the implementation is ok. Thanks!

Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

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

LGTM Thanks

@vicb vicb merged commit c20cc2f into main Oct 30, 2024
3 checks passed
@vicb vicb deleted the vb-branch-4 branch October 30, 2024 17:20
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