GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(node): Ensure correct URL is passed to `ignoreIncomingRequests` callback by Lms24 · Pull Request #12929 · getsentry/sentry-javascript Conversation
|
| integrations: [ | ||
| Sentry.httpIntegration({ | ||
| ignoreOutgoingRequests: url => { | ||
| return url.includes('example.com'); |
Code scanning / CodeQL
Incomplete URL substring sanitization
| */ | ||
| export function startExpressServerAndSendPortToRunner(app: Express): void { | ||
| const server = app.listen(0, () => { | ||
| export function startExpressServerAndSendPortToRunner(app: Express, port: number | undefined = undefined): void { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
small adjustment to our node integration tests framework: In the express apps, we can not optionally pass a fixed port which makes running the app locally a lot less painful 😅
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
|
||
| ignoreIncomingRequestHook: request => { | ||
| const url = getRequestUrl(request); | ||
| const url = request.url; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
just checking to be sure, is the url here the full URL, including protocol? so e.g. http://...? As we want these to be full URLs I guess always, if possible.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@mydea url is NOT the full url, it is instead just the path (and maybe the query params? EDIT: definitely has query params too.).
the node:IncomingMessage type doesn't have a protocol, hostname, or port attr.
req.socket.encrypted and infer true === httpsreq.socket.address().port, I think.So all that to say, sadly it's difficult to reconstruct the full url. Thoughts?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@mydea sorry i saw you moved your comment, so I just moved mine before I saw you replied 😅
I'll let you move your reply here so the comments aren't fragmented.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I feared that. IMHO this is OK, but we should maybe reflect this in the jsdoc/variables used for ignoreIncomingRequests, e.g. make it ignoreIncomingRequests(urlPath: string) or something like this?
Sounds reasonable to me but sadly this is a breaking change, no?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just changing the name of the variable is fine. Will make the change and update JSDoc and docs to reflect it. "Luckily" this never worked in v8 in the first place (afaict) so we're likely not behaviourally breaking folks.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Regarding docs update: I'll do this in combination with the changes from #12930
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
sounds good to me 🚀
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done: 9348717
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
size-limit report 📦
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Francesco Novy <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
node http integration: ignoreIncomingRequests() option does not work
There was an error while loading. Please reload this page.