-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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): compute client address #12222
Conversation
🦋 Changeset detectedLatest commit: 6a2ae1f The changes in this PR will be included in the next version bump. 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 |
} | ||
throw new AstroError(AstroErrorData.StaticClientAddressNotAvailable); | ||
clientIpAddress = getClientIpAddress(request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is done here so that we don't need to update each adapter to provide it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be able to add a test for this. I think this one would be the place: https://github.com/withastro/astro/blob/main/packages/astro/test/client-address.test.js
@matthewp the bug is around edge middleware specifically, we don't have those tests in core, I think |
@matthewp added a unit test |
Changes
Closes #12215
Closes PLT-2587
Testing
Added a unit test.
Existing CI should pass
Docs
N/A