cgi explanation reademe layout
This commit is contained in:
10
README.md
10
README.md
@@ -78,26 +78,32 @@
|
||||
[rfc 3875](https://www.rfc-editor.org/rfc/rfc3875)
|
||||
|
||||
[3.1: server responsabilities](https://www.rfc-editor.org/rfc/rfc3875#section-3.1)
|
||||
|
||||
- The server [...] receives the request from the client
|
||||
- selects a CGI script to handle the request
|
||||
- converts the client request to a CGI request
|
||||
- executes the script and converts the CGI response into a response for the client
|
||||
|
||||
[3.3: script uri](https://www.rfc-editor.org/rfc/rfc3875#section-3.3)
|
||||
|
||||
- the 'Script-URI' [...] MUST have the property that if the client had accessed this URI instead, then the script would have been executed
|
||||
|
||||
[4: how the server prepare the cgi requests](https://www.rfc-editor.org/rfc/rfc3875#section-4)
|
||||
|
||||
- the cgi receives 2 differents set of informations :
|
||||
- the request meta-variables (in UNIX, by env variables)
|
||||
- and the message-body
|
||||
|
||||
[4.1: request meta-variables](https://www.rfc-editor.org/rfc/rfc3875#section-4.1)
|
||||
|
||||
- a header field that spans multiple lines MUST be merged onto a single line
|
||||
|
||||
[4.2: request message-body](https://www.rfc-editor.org/rfc/rfc3875#section-4.2)
|
||||
|
||||
- unless defined otherwise, the script access request data by reading stdin
|
||||
|
||||
[6: how the response from the script is returned to the server](https://www.rfc-editor.org/rfc/rfc3875#section-6)
|
||||
|
||||
- The response comprises 2 parts, separated by a blank line :
|
||||
- a message-header
|
||||
- and a message-body
|
||||
@@ -105,6 +111,7 @@
|
||||
- The body may be NULL
|
||||
|
||||
[6.2: responses types](https://www.rfc-editor.org/rfc/rfc3875#section-6.2)
|
||||
|
||||
- four types of responses :
|
||||
- document response
|
||||
- local redirect response
|
||||
@@ -128,6 +135,7 @@
|
||||
- the server must check the cgi-script output, and modifie it to comply with the protocol version
|
||||
|
||||
[6.3: cgi header fields](https://www.rfc-editor.org/rfc/rfc3875#section-6.3)
|
||||
|
||||
- whitespace is permitted between the ":" and the field-value
|
||||
- but not between the field-name and the ":"
|
||||
- the CGI script can set three differents fields :
|
||||
@@ -158,11 +166,13 @@
|
||||
- the server must resolve conflicts between script-header fields and themselves
|
||||
|
||||
[6.3: cgi message body](https://www.rfc-editor.org/rfc/rfc3875#section-6.4)
|
||||
|
||||
- the server must read it untill EOF
|
||||
- the server must not modify it, except to convert charset if needed
|
||||
|
||||
[7 and 8: usefull informations about implementation and security](https://www.rfc-editor.org/rfc/rfc3875#section-7)
|
||||
|
||||
#### questions :
|
||||
- le cgi-script doit renvoyer au moins un header suivit d'une ligne vide
|
||||
- il peut dans certains cas envoyer d'autres headers
|
||||
- le serveur doit verifier qu'il n'y a pas de doublons dans les headers
|
||||
|
||||
Reference in New Issue
Block a user