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

net/http/cgi: CGI returns 200 OK for invalid results (including patch) #7198

Closed
gopherbot opened this issue Jan 23, 2014 · 7 comments
Closed
Milestone

Comments

@gopherbot
Copy link

by steven.hartland@multiplay.co.uk:

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. create a CGI app which runs a CGI script that returns no output
2. make CGI request to said script

What is the expected output?
As per RFC 3875 section 6.2 a CGI response should be:
CGI-Response = document-response | local-redir-response |                     
client-redir-response | client-redirdoc-response

A blank / no response is hence not valid and should return status code
http.StatusInternalServerError


What do you see instead?
Status code is http.Ok


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
FreeBSD 8.3-RELEASE

Which version are you using?  (run 'go version')
go version go1.2 freebsd/amd64

Please provide any additional information below.
Patch which fixes this behaviour attached

Attachments:

  1. cgi-501.patch (644 bytes)
@bradfitz
Copy link
Contributor

Comment 1:

We don't attach patches to the bug tracker.  Our development and code review workflow is
documented at:
http://golang.org/doc/contribute.html
Be sure to submit a CLA as well:
http://golang.org/doc/contribute.html#copyright

@davecheney
Copy link
Contributor

Comment 2:

Please submit your patch via the CLA process outlined in comment number 1.

@davecheney
Copy link
Contributor

Comment 3:

Status changed to WaitingForReply.

@rsc
Copy link
Contributor

rsc commented Mar 3, 2014

Comment 4:

This is a two-line fix. Someone please just recreate the CL.

Labels changed: added release-go1.3.

Status changed to Accepted.

@gopherbot
Copy link
Author

Comment 5 by mail@nicolasdavies.com.au:

I applied the patch as CL 72040043

@bradfitz
Copy link
Contributor

bradfitz commented Mar 6, 2014

Comment 6:

Fix and more tests in https://golang.org/cl/68960049
It doesn't look like CL 72040043 fully fixed it, and it seems an existing test would've
failed incorrectly with it as-is.

Labels changed: added repo-main.

Owner changed to @bradfitz.

Status changed to Started.

@bradfitz
Copy link
Contributor

Comment 7:

This issue was closed by revision d53251d.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants