Skip to content

Conversation

wirehead
Copy link

(this confused the heck out of me while trying to use Gorilla)

  • Changed request to be just r, like the other handlers.
  • Created complete wrapper function instead of just 2 lines.

(this confused the heck out of me while trying to use Gorilla)

* Changed `request` to be just `r`, like the other handlers.
* Created complete wrapper function instead of just 2 lines.
category := vars["category"]
func ArticlesCategoryHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why set this to "application/json", or anything at all? It doesn't really contribute anything to the example.

Copy link
Author

Choose a reason for hiding this comment

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

Good point. I'll fix that. :)

Review comment: setting the header complicates things.
@kisielk kisielk merged commit b128961 into gorilla:master Jan 17, 2017
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