Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-github: add support for issue locking / unlocking #280

Closed
wants to merge 1 commit into from

Conversation

gmlewis
Copy link
Collaborator

@gmlewis gmlewis commented Feb 12, 2016

Fixes #279.

Change-Id: I55ffdadfe5970d664ac94048e8bc2b8f5d935903

defer teardown()

mux.HandleFunc("/repos/o/r/issues/1/lock", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "PUT")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to better simulate the actual GitHub API, go ahead and have this return a 204 status:

w.WriteHeader(http.StatusNoContent)

same with Unlock test below

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. PTAL.

Fixes google#279.

Change-Id: I55ffdadfe5970d664ac94048e8bc2b8f5d935903
@willnorris
Copy link
Collaborator

two minor things:

  • I forgot to have you also check for the custom accept header
  • writing the response header is typically done after all the checks on the request

I've gone ahead and made these minor changes and merged as ac77c93.

@willnorris willnorris closed this Feb 16, 2016
@gmlewis gmlewis deleted the issue-lock-unlock branch February 16, 2016 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants