diff --git a/access_request_handler.go b/access_request_handler.go index 25dbd62a..6a994ec7 100644 --- a/access_request_handler.go +++ b/access_request_handler.go @@ -53,7 +53,7 @@ func (f *Fosite) NewAccessRequest(ctx context.Context, r *http.Request, session if r.Method != "POST" { return accessRequest, errorsx.WithStack(ErrInvalidRequest.WithHintf("HTTP method is '%s', expected 'POST'.", r.Method)) - } else if err := r.ParseMultipartForm(1 << 20); err != nil && err != http.ErrNotMultipart { + } else if err := r.ParseMultipartForm(1 << 20); err != nil && !errors.Is(err, http.ErrNotMultipart) { return accessRequest, errorsx.WithStack(ErrInvalidRequest.WithHint("Unable to parse HTTP body, make sure to send a properly formatted form request body.").WithWrap(err).WithDebug(err.Error())) } else if len(r.PostForm) == 0 { return accessRequest, errorsx.WithStack(ErrInvalidRequest.WithHint("The POST body can not be empty.")) diff --git a/request.go b/request.go index 26fe7365..593ec4f6 100644 --- a/request.go +++ b/request.go @@ -13,13 +13,14 @@ import ( // Request is an implementation of Requester type Request struct { - ID string `json:"id" gorethink:"id"` - RequestedAt time.Time `json:"requestedAt" gorethink:"requestedAt"` - Client Client `json:"client" gorethink:"client"` - RequestedScope Arguments `json:"scopes" gorethink:"scopes"` - GrantedScope Arguments `json:"grantedScopes" gorethink:"grantedScopes"` - Form url.Values `json:"form" gorethink:"form"` - Session Session `json:"session" gorethink:"session"` + ID string `json:"id"` + RequestedAt time.Time `json:"requestedAt"` + ExpiresAt time.Time `json:"expiresAt"` + Client Client `json:"client"` + RequestedScope Arguments `json:"scopes"` + GrantedScope Arguments `json:"grantedScopes"` + Form url.Values `json:"form"` + Session Session `json:"session"` RequestedAudience Arguments `json:"requestedAudience"` GrantedAudience Arguments `json:"grantedAudience"` Lang language.Tag `json:"-"`