-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Update KibanaRequest to use the new WHATWG URL API #80713
Conversation
3f0085c
to
6aa7526
Compare
x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts
Outdated
Show resolved
Hide resolved
Pinging @elastic/ingest-management (Team:Ingest Management) |
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.
Ingest manager changes 🚀
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
// | ||
// The details can be seen in this discussion on Twitter: | ||
// https://twitter.com/wa7son/status/1319992632366518277 | ||
let urlCopy = ''; |
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'm glad I didn't have to debug this 😄
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.
LGTM for Alerts, TaskManager & EventLog 👍
ACK: will review the security team related changes today or tomorrow morning at the latest. |
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.
LGTM 👍
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.
ML changes LGTM
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.
Awesome, looks good!
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
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.
Security/Spaces changes LGTM, thanks!
This PR is a prerequisite for upgrading to hapi v18.
The reason for this is that the new version of hapi uses the WHATWG URL format for its
request.url
property instead of the legacy url format.Note to reviewers
The hack of using
request._core.info.uri
to build the new URL object, isn't needed once we upgrade to hapi v18, as this version of hapi already uses the WHATWG URL API. So instead of constructing the URL object once theKibanaRequest
is instantiated, we simply copy it from the hapi request object.Note to future self
If you remove the
urlCopy
hack insrc/core/server/http/lifecycle/on_pre_routing.ts
, you can reproduce the problem it's trying to fix by first performing the following cURL request:This will prime the process and put it in a state where the error will occur in the next request, which you perform with the following cURL request:
The first cURL request will trigger the
request.setUrl
line insrc/core/server/http/lifecycle/on_pre_routing.ts
, which will screw up the internal object holding the routing table in such a way that thecall
router used byhapi
can't find thesaved_objects
segment underapi
and will make the request fall through to the catch-all route.The only thing needed from this PR to trigger the bug, is the following in
src/core/server/http/router/request.ts
: