Merge lp:~vds/usso/initialize_headers_before_assignment into lp:usso

Proposed by Vincenzo Di Somma
Status: Merged
Merged at revision: 26
Proposed branch: lp:~vds/usso/initialize_headers_before_assignment
Merge into: lp:usso
Diff against target: 35 lines (+3/-7)
2 files modified
oauth.go (+3/-0)
usso.go (+0/-7)
To merge this branch: bzr merge lp:~vds/usso/initialize_headers_before_assignment
Reviewer Review Type Date Requested Status
Matthew Williams (community) Approve
Andrew W. Deane (community) Approve
usso Hackers Pending
Review via email: mp+148565@code.launchpad.net

Commit message

Request Header map needs to be initialized before Header.Add can be used. The seed initialization is not needed in that module anymore.

Description of the change

Request Header map needs to be initialized before Header.Add can be used. The seed initialization is not needed in that module anymore.

To post a comment you must log in.
Revision history for this message
Andrew W. Deane (andrew-w-deane) :
review: Approve
Revision history for this message
Matthew Williams (mattyw) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'oauth.go'
--- oauth.go 2013-02-05 12:37:03 +0000
+++ oauth.go 2013-02-14 22:19:25 +0000
@@ -140,6 +140,9 @@
140func (ssodata *SSOData) SignRequest(140func (ssodata *SSOData) SignRequest(
141 rp *RequestParameters, req *http.Request) error {141 rp *RequestParameters, req *http.Request) error {
142 auth, error := ssodata.GetAuthorizationHeader(rp)142 auth, error := ssodata.GetAuthorizationHeader(rp)
143 if req.Header == nil {
144 req.Header = make(map[string][]string)
145 }
143 req.Header.Add("Authorization", auth)146 req.Header.Add("Authorization", auth)
144 return error147 return error
145}148}
146149
=== modified file 'usso.go'
--- usso.go 2013-01-31 17:57:52 +0000
+++ usso.go 2013-02-14 22:19:25 +0000
@@ -6,17 +6,10 @@
6 "fmt"6 "fmt"
7 "io/ioutil"7 "io/ioutil"
8 "log"8 "log"
9 "math/rand"
10 "net/http"9 "net/http"
11 "strings"10 "strings"
12 "time"
13)11)
1412
15func init() {
16 // Initialize the random generator.
17 rand.Seed(time.Now().UTC().UnixNano())
18}
19
20type UbuntuSSOServer struct {13type UbuntuSSOServer struct {
21 baseUrl string14 baseUrl string
22}15}

Subscribers

People subscribed via source and target branches

to all changes: