]> Cypherpunks repositories - gostls13.git/commit
net/http: add BasicAuth method to *http.Request
authorKelsey Hightower <kelsey.hightower@gmail.com>
Sat, 30 Aug 2014 05:19:30 +0000 (22:19 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 30 Aug 2014 05:19:30 +0000 (22:19 -0700)
commit29f9f3ec80237ff0b2eb17f042747c08a10e0a14
tree7fefd889cb89570ceffa5b2ff4c279ad740e5416
parent397bdb216f705a3e3221c98904237820d4950042
net/http: add BasicAuth method to *http.Request

The net/http package supports setting the HTTP Authorization header
using the Basic Authentication Scheme as defined in RFC 2617, but does
not provide support for extracting the username and password from an
authenticated request using the Basic Authentication Scheme.

Add BasicAuth method to *http.Request that returns the username and
password from authenticated requests using the Basic Authentication
Scheme.

Fixes #6779.

LGTM=bradfitz
R=golang-codereviews, josharian, bradfitz, alberto.garcia.hierro, blakesgentry
CC=golang-codereviews
https://golang.org/cl/76540043
src/pkg/net/http/request.go
src/pkg/net/http/request_test.go