Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Error out on redirects #61

Merged
merged 1 commit into from

2 participants

@as016194

Currently, if a redirect is encountered by the client, it will return successfully with the response body. Not all redirects have response bodies, and the upload was not successful. Ideally the client would follow redirects, but this is a quick fix to avoid silent failure.

@as016194 as016194 Error out on redirects.
This way a silent failure won't occur for redirects without a body.
c553ce6
@cwninja
Owner

Looks good, http_client should follow redirects that are not mental anyway.

Cheers.

@cwninja cwninja merged commit a079123 into geminabox:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 5, 2012
  1. @as016194

    Error out on redirects.

    as016194 authored
    This way a silent failure won't occur for redirects without a body.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/geminabox_client.rb
View
2  lib/geminabox_client.rb
@@ -28,7 +28,7 @@ def url_for(path)
def push(gemfile)
response = http_client.post(url_for(:upload), {'file' => File.open(gemfile, "rb")}, {'Accept' => 'text/plain'})
- if response.status < 400
+ if response.status < 300
response.body
else
raise GeminaboxClient::Error, "Error (#{response.code} received)\n\n#{response.body}"
Something went wrong with that request. Please try again.