Skip to content

Tweak for authorizing against Node.js server #10

@i-rus

Description

@i-rus

Great gem, BTW. Thank you for that. Just wanted to let you know about a small issue I came across. The example provided fails to authorize when connecting to a Node.js server. The problem seems to be due to an initial nc value of "00000000". This causes the Node.js server to return a "stale" error. The fix I found (without touching the digest_auth code) was to call next_nonce before calling auth_header.

d=Net::HTTP::DigestAuth.new
d.next_nonce
auth = d.auth_header uri, au, 'GET'

Having @nonce_count initialized to a value of 1 in digest_auth would avoid this issue altogether.

Best,

John

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions