Skip to content

Commit

Permalink
Rename parser
Browse files Browse the repository at this point in the history
  • Loading branch information
utahta committed Nov 21, 2017
1 parent 674f7d9 commit 043c5ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _example/auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func Authorize(w http.ResponseWriter, req *http.Request) {
}

func Callback(w http.ResponseWriter, req *http.Request) {
resp, err := auth.ParseAuthorize(req)
resp, err := auth.ParseRequest(req)
if err != nil {
fmt.Fprintf(w, "error:%v", err)
return
Expand Down
4 changes: 2 additions & 2 deletions auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func (c *Client) Redirect(w http.ResponseWriter, req *http.Request) error {
return nil
}

// ParseAuthorize parses authorize request
func ParseAuthorize(r *http.Request) (*AuthorizeResponse, error) {
// ParseRequest parses authorize request
func ParseRequest(r *http.Request) (*AuthorizeResponse, error) {
resp := &AuthorizeResponse{
Code: r.FormValue("code"),
State: r.FormValue("state"),
Expand Down
2 changes: 1 addition & 1 deletion auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestParseAuthorize(t *testing.T) {

for _, test := range tests {
req := &http.Request{Form: test.urlValues}
resp, err := ParseAuthorize(req)
resp, err := ParseRequest(req)

if test.expectError {
if err == nil {
Expand Down

0 comments on commit 043c5ca

Please sign in to comment.