Skip to content

embed the http.ResponseWriter into the response struct #179

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

Closed
wants to merge 1 commit into from
Closed

embed the http.ResponseWriter into the response struct #179

wants to merge 1 commit into from

Conversation

plamb
Copy link
Contributor

@plamb plamb commented Jun 13, 2013

this removes the need to write resp.Out.Header() and instead can be resp.Header(). Could cause breaking changes in user code.

The http.WriterHeader func has been renamed to WriteStatusCode to avoid a conflict with http.ResponseWriter.WriteHeader

…d Out), this removes the need to write resp.Out.Header() and instead can be resp.Header(). Could cause breaking changes in user code.
@robfig
Copy link
Contributor

robfig commented Jun 16, 2013

The refactoring to SetStatus and SetContentType still looks broken to me. Did you successfully push your latest stuff? If so, what are you trying to achieve with the refactoring? Maybe we can achieve it in a different way.

Note that the purpose of WriteHeader is not to allow the developer to set the status code and content type. The developer does that by assigning to c.Response.Status and c.Response.ContentType. This func is so that result implementations can specify a default status/content-type. That functionality is combined with writing the header, because that is the point at which it must be evaluated.

I would suggest leaving it as-is unless you see a simplification that meets that same need.

@plamb
Copy link
Contributor Author

plamb commented Jun 16, 2013

It's been a few days and if I recall correctly, I renamed that function because it clashes with an http.ResponseWriter one of the same name (but it's been long enough that I could be totally wrong). I'll take a look at it when I get back tonight.

@plamb
Copy link
Contributor Author

plamb commented Jun 16, 2013

Rob, somethings not right. I put those methods back as one and just renamed it so that it wouldn't clash (error below). I thought I'd pushed that change to github but it doesn't look like it. Sorry for the hassle, I'll clean it up.

@plamb plamb closed this Jun 16, 2013
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