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

Requests to 500.cgi #74

Open
ghost opened this issue Nov 26, 2019 · 1 comment
Open

Requests to 500.cgi #74

ghost opened this issue Nov 26, 2019 · 1 comment
Labels
Question Need some information Resolved The issue is resolved or got answered

Comments

@ghost
Copy link

ghost commented Nov 26, 2019

Through the tests and it's naming, I understand that the cgi script /a5-test/500.cgi is intended to cause a 500 Internal Server Error response. I am uncertain as to what about the script is supposed to lead to this response though. The permissions have x and r, the perl is entirely valid and it does not seem to give "malformed output".

What am I missing?

@ibnesayeed ibnesayeed added the Question Need some information label Nov 26, 2019
@ibnesayeed
Copy link
Collaborator

I think you did not attend the CGI lecture and when we revisited it last week. A CGI script must contain at least one header/status line. The full detains of what is optional and what is inferred in certain situations can be read in the RFC 3875. There are some examples to highlight some scenarios in the lecture slides. The 500.cgi script generates file listing, but it should have at least the Content-type header in it and a blank line before the entity body starts (if the commented line in the script was uncommented, it will become a valid CGi script).

6.2.  Response Types

   The response comprises a message-header and a message-body, separated
   by a blank line.  The message-header contains one or more header
   fields.  The body may be NULL.

      generic-response = 1*header-field NL [ response-body ]
6.3.1.  Content-Type

   The Content-Type response field sets the Internet Media Type [6] of
   the entity body.

      Content-Type = "Content-Type:" media-type NL

   If an entity body is returned, the script MUST supply a Content-Type
   field in the response.  If it fails to do so, the server SHOULD NOT
   attempt to determine the correct content type.  The value SHOULD be
   sent unmodified to the client, except for any charset parameter
   changes.

@ibnesayeed ibnesayeed added the Resolved The issue is resolved or got answered label Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Need some information Resolved The issue is resolved or got answered
Projects
None yet
Development

No branches or pull requests

1 participant