Skip to content

Instantly share code, notes, and snippets.

View n8agrin's full-sized avatar
🐢

Nathan Agrin n8agrin

🐢
View GitHub Profile
@n8agrin
n8agrin / net_http_digest_auth.rb
Created March 3, 2009 00:29
HTTP Digest Auth for Ruby's net/http
# Support for http digest auth
# Discovered here: http://johan.bingodisk.com/public/code/net_digest_auth.rb
require 'digest/md5'
require 'net/http'
module Net
module HTTPHeader
@@nonce_count = -1
CNONCE = Digest::MD5.new("%x" % (Time.now.to_i + rand(65535))).hexdigest