goji/httpauth — pull request #5 by mgurevin (2014-10-16 13:52:15+00:00)
Title: Remove extra double quotes from Realm

According to Go documents `%q` already wraps string with double quotes.

%s	the uninterpreted bytes of the string or slice
%q	a double-quoted string safely escaped with Go syntax
%x	base 16, lower-case, two characters per byte
%X	base 16, upper-case, two characters per byte

This produces a header like this and breaks Perl LWP::UserAgent->credentials

HTTP/1.1 401 Unauthorized
Content-Type: text/plain; charset=utf-8
Www-Authenticate: Basic realm=""Restricted""
Date: ...
Content-Length: 13

Thus, I removed extra quotes and Realm value is now correctly escaped and wrapped into quotes only once[1]]

Www-Authenticate: Basic realm="Restricted"

[0]: http://golang.org/pkg/fmt/
[1]: http://en.wikipedia.org/wiki/Basic_access_authentication#Server_side