Merge branch 'fix-header-map' into work

This commit is contained in:
Tim Möhlmann 2024-08-20 10:47:19 +03:00
commit f5cd665097
2 changed files with 8 additions and 3 deletions

View file

@ -428,6 +428,7 @@ func TestTryErrorRedirect(t *testing.T) {
parent: oidc.ErrInteractionRequired().WithDescription("sign in"), parent: oidc.ErrInteractionRequired().WithDescription("sign in"),
}, },
want: &Redirect{ want: &Redirect{
Header: make(http.Header),
URL: "http://example.com/callback?error=interaction_required&error_description=sign+in&state=state1", URL: "http://example.com/callback?error=interaction_required&error_description=sign+in&state=state1",
}, },
wantLog: `{ wantLog: `{

View file

@ -218,6 +218,7 @@ type Response struct {
// without custom headers. // without custom headers.
func NewResponse(data any) *Response { func NewResponse(data any) *Response {
return &Response{ return &Response{
Header: make(http.Header),
Data: data, Data: data,
} }
} }
@ -242,7 +243,10 @@ type Redirect struct {
} }
func NewRedirect(url string) *Redirect { func NewRedirect(url string) *Redirect {
return &Redirect{URL: url} return &Redirect{
Header: make(http.Header),
URL: url,
}
} }
func (red *Redirect) writeOut(w http.ResponseWriter, r *http.Request) { func (red *Redirect) writeOut(w http.ResponseWriter, r *http.Request) {