mikehale-rat-hole 0.1.5 → 0.1.6

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/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.1.6 / 2008-12-18
2
+
3
+ * properly calculate request_uri if query_string is empty
4
+
1
5
  === 0.1.5 / 2008-12-18
2
6
 
3
7
  * calculate request_uri = path_info + query_string
data/Rakefile CHANGED
@@ -18,6 +18,7 @@ Hoe.new('rat-hole', RatHole::VERSION) do |p|
18
18
  p.email = 'mikehale@gmail.com'
19
19
  end
20
20
 
21
+ desc %(Update the gemspec so that github will build a new gem: http://gems.github.com/)
21
22
  task :update_gemspec do
22
23
  begin
23
24
  old_stdout = STDOUT.dup
data/lib/rat_hole.rb CHANGED
@@ -6,7 +6,7 @@ require 'util'
6
6
 
7
7
  class RatHole
8
8
 
9
- VERSION = '0.1.5'
9
+ VERSION = '0.1.6'
10
10
 
11
11
  def initialize(host)
12
12
  @host = host
@@ -27,7 +27,12 @@ class RatHole
27
27
  env.delete('HTTP_ACCEPT_ENCODING')
28
28
  source_request = process_user_request(Rack::Request.new(env))
29
29
  source_headers = request_headers(source_request.env)
30
- request_uri = "#{source_request.path_info}?#{source_request.query_string}"
30
+
31
+ if source_request.query_string.nil? || source_request.query_string == ''
32
+ request_uri = source_request.path_info
33
+ else
34
+ request_uri = "#{source_request.path_info}?#{source_request.query_string}"
35
+ end
31
36
 
32
37
  if source_request.get?
33
38
  response = http.get(request_uri, source_headers)
data/rat-hole.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{rat-hole}
3
- s.version = "0.1.5"
3
+ s.version = "0.1.6"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Michael Hale", "David Bogus"]
@@ -165,6 +165,10 @@ class TestRatHole < Test::Unit::TestCase
165
165
  send_get_request({}, '/uri?with=param')
166
166
  assert_equal('/uri?with=param', proxied_request.uri)
167
167
 
168
+ mock_server
169
+ send_get_request({}, '/uri')
170
+ assert_equal('/uri', proxied_request.uri)
171
+
168
172
  mock_server
169
173
  send_post_request('', '/uri?with=param')
170
174
  assert_equal('/uri?with=param', proxied_request.uri)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mikehale-rat-hole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hale