Skip to content

Commit

Permalink
fix: resolve regression (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr authored Feb 5, 2021
1 parent c2375de commit 173d60e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion authorize_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ type AuthorizeRequest struct {
func NewAuthorizeRequest() *AuthorizeRequest {
return &AuthorizeRequest{
ResponseTypes: Arguments{},
RedirectURI: &url.URL{},
HandledResponseTypes: Arguments{},
Request: *NewRequest(),
ResponseMode: ResponseModeDefault,
// The redirect URL must be unset / nil for redirect detection to work properly:
// RedirectURI: &url.URL{},
}
}

Expand Down
5 changes: 5 additions & 0 deletions authorize_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@
package fosite

import (
"github.com/stretchr/testify/require"
"net/url"
"testing"
"time"

"github.com/stretchr/testify/assert"
)

func TestAuthorizeRequestURLRegression(t *testing.T) {
require.Nil(t, NewAuthorizeRequest().RedirectURI)
}

func TestAuthorizeRequest(t *testing.T) {
var urlparse = func(rawurl string) *url.URL {
u, _ := url.Parse(rawurl)
Expand Down

0 comments on commit 173d60e

Please sign in to comment.