rubysspi 1.0.4-i386-mswin32 → 1.0.5-i386-mswin32

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/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/testtask'
6
6
  spec = Gem::Specification.new do |s|
7
7
  s.name = "rubysspi"
8
8
  s.summary = "A library which implements Ruby bindings to the Win32 SSPI library. Also includes a module to add Negotiate authentication support to Net::HTTP."
9
- s.version = "1.0.4"
9
+ s.version = "1.0.5"
10
10
  s.author = "Justin Bailey"
11
11
  s.email = "jgbailey @nospam@ gmail.com"
12
12
  s.homepage = "http://rubyforge.org/projects/rubysspi/"
@@ -33,6 +33,9 @@ module Net
33
33
  end_transport req, res
34
34
  begin_transport req
35
35
  req["Proxy-Authorization"] = "Negotiate #{n.get_initial_token}"
36
+ # Some versions of ISA will close the connection if this isn't present.
37
+ req["Connection"] = "Keep-Alive"
38
+ req["Proxy-Connection"] = "Keep-Alive"
36
39
  req.exec @socket, @curr_http_version, edit_path(req.path)
37
40
  begin
38
41
  res = HTTPResponse.read_new(@socket)
@@ -40,6 +43,8 @@ module Net
40
43
  if res["Proxy-Authenticate"]
41
44
  res.reading_body(@socket, req.response_body_permitted?) { }
42
45
  req["Proxy-Authorization"] = "Negotiate #{n.complete_authentication res["Proxy-Authenticate"]}"
46
+ req["Connection"] = "Keep-Alive"
47
+ req["Proxy-Connection"] = "Keep-Alive"
43
48
  req.exec @socket, @curr_http_version, edit_path(req.path)
44
49
  begin
45
50
  res = HTTPResponse.read_new(@socket)
@@ -1,3 +1,6 @@
1
+ # Magic constant will ensure that, if the SSPI patch has been applied, it won't break these tests
2
+ DISABLE_RUBY_SSPI_PATCH = true
3
+
1
4
  require 'test/unit'
2
5
  require 'net/http'
3
6
  require 'rubygems'
@@ -7,19 +7,28 @@ $: << (File.dirname(__FILE__) << "/../lib")
7
7
  require 'rubysspi/proxy_auth'
8
8
 
9
9
  class NTLMTest < Test::Unit::TestCase
10
- def setup
11
- assert ENV["http_proxy"], "http_proxy must be set before running tests."
10
+ def test_net_http
11
+ proxy = get_proxy
12
+ Net::HTTP.Proxy(proxy.host, proxy.port).start("www.google.com") do |http|
13
+ resp = http.get("/")
14
+ assert resp.code.to_i == 200, "Did not get response from Google as expected."
15
+ end
12
16
  end
13
17
 
14
- def test_net_http
15
-
18
+ def test_head_request
19
+ proxy = get_proxy
20
+ Net::HTTP.Proxy(proxy.host, proxy.port).start("www.google.com") do |http|
21
+ resp = http.head("/")
22
+ assert resp.code.to_i == 200, "Did not get response from Google as expected."
23
+ end
24
+
25
+ end
26
+
27
+ def get_proxy
16
28
  assert ENV["http_proxy"], "http_proxy environment variable must be set."
17
29
  proxy = URI.parse(ENV["http_proxy"])
18
30
  assert proxy.host && proxy.port, "Could not parse http_proxy (#{ENV["http_proxy"]}). http_proxy should be a URL with a port (e.g. http://proxy.corp.com:8080)."
19
31
 
20
- Net::HTTP.Proxy(proxy.host, proxy.port).start("www.google.com") do |http|
21
- resp = http.get("/")
22
- assert resp.code.to_i == 200, "Did not get response from Google as expected."
23
- end
32
+ return proxy
24
33
  end
25
34
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: rubysspi
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.4
7
- date: 2006-11-01 00:00:00 -08:00
6
+ version: 1.0.5
7
+ date: 2006-12-01 00:00:00 -08:00
8
8
  summary: A library which implements Ruby bindings to the Win32 SSPI library. Also includes a module to add Negotiate authentication support to Net::HTTP.
9
9
  require_paths:
10
10
  - lib