Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Using HTTP HEAD instead of GET #10

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

bkutil commented Nov 3, 2011

The changes were a bit more extensive than I previously thought. They were needed to correctly use HEAD in case of redirects.

Owner

djberg96 commented Nov 4, 2011

Hm, something's happened, I can't auto merge now.

Contributor

bkutil commented Nov 4, 2011

I can re-clone from your current master and create a fresh branch without the is_a? patch. Or feel free to cherry pick + amend my changes.

Owner

djberg96 commented Nov 4, 2011

Please re-clone if you don't mind. :)

Contributor

bkutil commented Nov 4, 2011

Yep, no prob.

Use HTTP head instead of GET by default
This patch replaces the http GET request with HEAD. HEAD requests should
be handled identically, but the response does not contain message
body. GET will still be used when @get_request option is set to true.

Replacing the get_response (which calls GET internally) with a new
http HEAD request would mean code duplication. Thus, the part that does
the actual ping is refactored to a separate private method.
This also means that new requests resulting from redirections are
now subject to timeout limit and they'll correctly use https.

Signed-off-by: Balazs Kutil <kutil.balazs@gmail.com>

@bkutil bkutil closed this Nov 4, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment