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

[console] support HEAD requests #10611

Merged
merged 4 commits into from
Mar 29, 2017

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Feb 28, 2017

Hapi handles HEAD requests automatically (by ignoring the body of a GET response) which prevents the console proxy from handling them correctly. To fix this the console proxy now only accepts requests with the POST method and requires the path and method in the query string.

@spalger
Copy link
Contributor Author

spalger commented Feb 28, 2017

jenkins, test this

@jbudz
Copy link
Member

jbudz commented Mar 23, 2017

Is it possible to include the warning headers in the response too?
image
HTTP/1.1 200 OK
Warning: [HEAD /{index}/{type}] is deprecated! Use [HEAD /{index}/_mapping/{type}] instead.
From #9874

@spalger spalger force-pushed the fix/console-head-requests branch from 2bbb1ff to 9bf43b2 Compare March 24, 2017 05:12
spalger added 2 commits March 23, 2017 22:14
Hapi handles HEAD requests automatically (by ignoring the body of a GET response) which prevents the console proxy from handling them correctly. To fix this the console proxy now only accepts requests with the POST method and requires the path and method in the query string.
@spalger spalger force-pushed the fix/console-head-requests branch from 9bf43b2 to 5e932e4 Compare March 24, 2017 05:14
@spalger
Copy link
Contributor Author

spalger commented Mar 24, 2017

Good catch @jbudz, fixed

Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

Nice coding spalger, I gave this thorough pass and it looks close.

Two small items,
lint errors look legitimate
should the HEAD requests return content length?

@spalger
Copy link
Contributor Author

spalger commented Mar 28, 2017

Fixed the lint errors. As far as I can tell hapi calculates the content-length automatically (that is to say it removes it and uses chunked encoding) but I'm not sure why...

@jbudz
Copy link
Member

jbudz commented Mar 29, 2017

jenkins, test this

@spalger spalger merged commit e48a1a9 into elastic:master Mar 29, 2017
elastic-jasper added a commit that referenced this pull request Mar 29, 2017
Backports PR #10611

**Commit 1:**
[console] support HEAD requests

Hapi handles HEAD requests automatically (by ignoring the body of a GET response) which prevents the console proxy from handling them correctly. To fix this the console proxy now only accepts requests with the POST method and requires the path and method in the query string.

* Original sha: d0aec25
* Authored by spalger <[email protected]> on 2017-02-28T02:03:23Z

**Commit 2:**
[console] proxy 'Warning' header from es

* Original sha: 5e932e4
* Authored by spalger <[email protected]> on 2017-03-24T05:01:38Z

**Commit 3:**
Merge branch 'master' of github.com:elastic/kibana into fix/console-head-requests

* Original sha: 3145506
* Authored by spalger <[email protected]> on 2017-03-28T23:04:50Z

**Commit 4:**
[console] fix lint errors

* Original sha: c4f4bd8
* Authored by spalger <[email protected]> on 2017-03-28T23:08:42Z
@spalger spalger deleted the fix/console-head-requests branch March 29, 2017 19:14
spalger pushed a commit that referenced this pull request Mar 29, 2017
Backports PR #10611

**Commit 1:**
[console] support HEAD requests

Hapi handles HEAD requests automatically (by ignoring the body of a GET response) which prevents the console proxy from handling them correctly. To fix this the console proxy now only accepts requests with the POST method and requires the path and method in the query string.

* Original sha: d0aec25
* Authored by spalger <[email protected]> on 2017-02-28T02:03:23Z

**Commit 2:**
[console] proxy 'Warning' header from es

* Original sha: 5e932e4
* Authored by spalger <[email protected]> on 2017-03-24T05:01:38Z

**Commit 3:**
Merge branch 'master' of github.com:elastic/kibana into fix/console-head-requests

* Original sha: 3145506
* Authored by spalger <[email protected]> on 2017-03-28T23:04:50Z

**Commit 4:**
[console] fix lint errors

* Original sha: c4f4bd8
* Authored by spalger <[email protected]> on 2017-03-28T23:08:42Z
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