kamu-wang 0.04 → 0.05
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/wang.rb +4 -4
- data/rakefile +1 -1
- data/wang.gemspec +1 -1
- metadata +1 -1
data/lib/wang.rb
CHANGED
|
@@ -187,14 +187,14 @@ module WANG
|
|
|
187
187
|
|
|
188
188
|
def generate_request_headers request_method, uri, referer
|
|
189
189
|
request_path = uri.path + (uri.query.nil? ? '' : "?#{uri.query}")
|
|
190
|
-
request_host = uri.host + (uri.port ? ":#{uri.port}" : '')
|
|
190
|
+
request_host = uri.host + ((uri.port && uri.port != 80) ? ":#{uri.port}" : '')
|
|
191
191
|
[
|
|
192
192
|
"#{request_method} #{@proxy_host ? uri.to_s : request_path} HTTP/1.1",
|
|
193
193
|
"Host: #{request_host}",
|
|
194
|
-
"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.
|
|
194
|
+
"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0",
|
|
195
195
|
"Accept: application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
|
|
196
196
|
"Accept-Language: en-us,en;q=0.5",
|
|
197
|
-
"Accept-Encoding: gzip,deflate
|
|
197
|
+
"Accept-Encoding: gzip,deflate",
|
|
198
198
|
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7",
|
|
199
199
|
"Keep-Alive: 300",
|
|
200
200
|
"Connection: #{@no_keepalive ? "close" : "keep-alive"}",
|
|
@@ -272,7 +272,7 @@ module WANG
|
|
|
272
272
|
end
|
|
273
273
|
|
|
274
274
|
def follow_redirect location
|
|
275
|
-
@log.debug(location.inspect)
|
|
275
|
+
@log.debug("Redirect to #{location.inspect}")
|
|
276
276
|
dest = location.to_uri
|
|
277
277
|
get(dest)
|
|
278
278
|
end
|
data/rakefile
CHANGED
|
@@ -8,7 +8,7 @@ task :default => [:test]
|
|
|
8
8
|
spec = Gem::Specification.new do |s|
|
|
9
9
|
s.platform = Gem::Platform::RUBY
|
|
10
10
|
s.name = 'wang'
|
|
11
|
-
s.version = "0.
|
|
11
|
+
s.version = "0.05"
|
|
12
12
|
s.summary = "Web Access with No Grief."
|
|
13
13
|
s.authors = ["Kamu", "Joux3"]
|
|
14
14
|
s.email = "mr.kamu@gmail.com"
|
data/wang.gemspec
CHANGED