Skip to content

Conversation

LekoArts
Copy link
Contributor

@LekoArts LekoArts commented Sep 3, 2024

Description

Previously, when you called the middleware with a req of let's say //, an error was thrown that crashed the server. The new URL(req.url || '', `${protocol}://clerk-dummy`) call is now inside a try/catch so that the error can be passed to next().

Fixes ECO-181

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented Sep 3, 2024

🦋 Changeset detected

Latest commit: 7f5352b

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

This PR includes changesets to release 1 package
Name Type
@clerk/clerk-sdk-node 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

@LekoArts LekoArts changed the title fix(sdk-node): Correctly forward errors to next() if request URL is invalid fix(clerk-sdk-node): Correctly forward errors to next() if request URL is invalid Sep 3, 2024
@LekoArts LekoArts merged commit 864e651 into main Sep 4, 2024
23 checks passed
@LekoArts LekoArts deleted the lekoarts/eco-181-ensure-that-express-middleware-doesnt-throw-if-provided-with branch September 4, 2024 07:43
wobsoriano pushed a commit that referenced this pull request Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants