[#59462] [ruby-trunk - Bug #9342][Open] [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3 — "jsc (Justin Collins)" <redmine@...>

9 messages 2014/01/02

[#59466] [ruby-trunk - Bug #9343][Open] [PATCH] SizedQueue#max= wakes up waiters properly — "normalperson (Eric Wong)" <normalperson@...>

11 messages 2014/01/02

[#59498] [ruby-trunk - Bug #9352][Open] [BUG] rb_sys_fail_str(connect(2) for [fe80::1%lo0]:3000) - errno == 0 — "kain (Claudio Poli)" <claudio@...>

10 messages 2014/01/03

[#59516] [ruby-trunk - Bug #9356][Open] TCPSocket.new does not seem to handle INTR — "charliesome (Charlie Somerville)" <charliesome@...>

48 messages 2014/01/03

[#59538] [ruby-trunk - Feature #9362][Assigned] Minimize cache misshit to gain optimal speed — "shyouhei (Shyouhei Urabe)" <shyouhei@...>

33 messages 2014/01/03
[#59582] Re: [ruby-trunk - Feature #9362][Assigned] Minimize cache misshit to gain optimal speed — SASADA Koichi <ko1@...> 2014/01/06

Intersting challenge.

[#59541] Re: [ruby-trunk - Feature #9362][Assigned] Minimize cache misshit to gain optimal speed — Eric Wong <normalperson@...> 2014/01/04

Hi, I noticed a trivial typo in array.c, and it fails building struct.c

[#59583] [ruby-trunk - Bug #9367][Open] REXML::XmlDecl doesn't use user specified quotes — "bearmini (Takashi Oguma)" <bear.mini@...>

12 messages 2014/01/06

[#59642] [ruby-trunk - Bug #9384][Open] Segfault in ruby 2.1.0p0 — "cbliard (Christophe Bliard)" <christophe.bliard@...>

11 messages 2014/01/08

[#59791] About unmarshallable DRb objects life-time — Rodrigo Rosenfeld Rosas <rr.rosas@...>

A while ago I created a proof-of-concept that I intended to use in my

16 messages 2014/01/15
[#59794] Re: About unmarshallable DRb objects life-time — Eric Hodel <drbrain@...7.net> 2014/01/15

On 15 Jan 2014, at 11:58, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> wrote:

[#59808] Re: About unmarshallable DRb objects life-time — Rodrigo Rosenfeld Rosas <rr.rosas@...> 2014/01/16

Em 15-01-2014 19:42, Eric Hodel escreveu:

[#59810] Re: About unmarshallable DRb objects life-time — Eric Hodel <drbrain@...7.net> 2014/01/16

On 16 Jan 2014, at 02:15, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> wrote:

[#59826] Re: About unmarshallable DRb objects life-time — Rodrigo Rosenfeld Rosas <rr.rosas@...> 2014/01/17

Em 16-01-2014 19:43, Eric Hodel escreveu:

[#59832] Re: About unmarshallable DRb objects life-time — Eric Hodel <drbrain@...7.net> 2014/01/17

On 17 Jan 2014, at 04:22, Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> wrote:

[ruby-core:60362] [ruby-trunk - Bug #9467] [Feedback] Net::HTTP does unzip zipped content

From: drbrain@...7.net
Date: 2014-01-30 20:52:33 UTC
List: ruby-core #60362
Issue #9467 has been updated by Eric Hodel.

Tracker changed from Backport to Bug
Project changed from Backport200 to ruby-trunk
Category set to lib
Status changed from Open to Feedback
Priority changed from High to Normal

I can't reproduce.  The URI you've given is correctly decompressed by Net::HTTP using ruby 2.0.0:

    $ cat test.rb
    require 'net/http'
    require 'pp'
    
    uri = URI("http://vimeo.com/api/oembed.json?url=http://vimeo.com/69655841&width=150")
    http = Net::HTTP.new(uri.host, uri.port)
    http.set_debug_output $stderr
    
    res = http.get(uri.request_uri)
    
    pp res.to_hash
    
    p res.body[0, 30]

    $ ruby20 -v test.rb 
    ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.0.0]
    opening connection to vimeo.com:80...
    opened
    <- "GET /api/oembed.json?url=http://vimeo.com/69655841&width=150 HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nConnection: close\r\nHost: vimeo.com\r\n\r\n"
    -> "HTTP/1.1 200 OK\r\n"
    -> "Server: Apache\r\n"
    -> "Access-Control-Allow-Origin: *\r\n"
    -> "Access-Control-Allow-Headers: X-Requested-With\r\n"
    -> "Expires: Thu, 30 Jan 2014 20:52:07 GMT\r\n"
    -> "Last-Modified: Thu, 30 Jan 2014 20:12:02 GMT\r\n"
    -> "Etag: \"215c14df5b7b774ff7b23cfb02b34da62c9ec022\"\r\n"
    -> "X-UA-Compatible: IE=edge\r\n"
    -> "X-DNS-Prefetch-Control: on\r\n"
    -> "Vary: Accept-Encoding\r\n"
    -> "Content-Encoding: gzip\r\n"
    -> "Content-Type: application/json\r\n"
    -> "Content-Length: 745\r\n"
    -> "Accept-Ranges: bytes\r\n"
    -> "Date: Thu, 30 Jan 2014 20:51:07 GMT\r\n"
    -> "X-Varnish: 2058928850\r\n"
    -> "Age: 0\r\n"
    -> "Via: 1.1 varnish\r\n"
    -> "X-Varnish-Cache: 0\r\n"
    -> "Connection: close\r\n"
    -> "X-VServer: 10.90.128.147\r\n"
    -> "\r\n"
    reading 745 bytes...
    -> "\x1F\x8B\b\x00\x00\x00\x00\x00\x00\x03[snipped gzip response]"
    read 745 bytes
    Conn close
    {"server"=>["Apache"],
     "access-control-allow-origin"=>["*"],
     "access-control-allow-headers"=>["X-Requested-With"],
     "expires"=>["Thu, 30 Jan 2014 20:52:07 GMT"],
     "last-modified"=>["Thu, 30 Jan 2014 20:12:02 GMT"],
     "etag"=>["\"215c14df5b7b774ff7b23cfb02b34da62c9ec022\""],
     "x-ua-compatible"=>["IE=edge"],
     "x-dns-prefetch-control"=>["on"],
     "vary"=>["Accept-Encoding"],
     "content-type"=>["application/json"],
     "content-length"=>["745"],
     "accept-ranges"=>["bytes"],
     "date"=>["Thu, 30 Jan 2014 20:51:07 GMT"],
     "x-varnish"=>["2058928850"],
     "age"=>["0"],
     "via"=>["1.1 varnish"],
     "x-varnish-cache"=>["0"],
     "connection"=>["close"],
     "x-vserver"=>["10.90.128.147"]}
    "{\"type\":\"video\",\"version\":\"1.0"


----------------------------------------
Bug #9467: Net::HTTP does unzip zipped content
https://bugs.ruby-lang.org/issues/9467#change-44844

* Author: Amitav Mohanty
* Status: Feedback
* Priority: Normal
* Assignee: Amitav Mohanty
* Category: lib
* Target version: 
* ruby -v: ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
* Backport: 
----------------------------------------
According to the Compression section of the documentation of Net::HTTP, it should automatically uncompress compressed responses. However, when I tried with a number of JSON requests with different servers, I am not getting automatic decompression.

require 'net/http'
uri = URI("http://yourhost.com")
http = Net::HTTP.new(uri.host, uri.port)
res = http.get(uri.request_uri)

You can test hitting http://vimeo.com/api/oembed.json?url=http://vimeo.com/69655841&width=150



-- 
http://bugs.ruby-lang.org/

In This Thread

Prev Next