From c331b69600da6cabc5d709d1446c98805e198f59 Mon Sep 17 00:00:00 2001 From: hugogogo Date: Tue, 2 Aug 2022 23:42:45 +0200 Subject: [PATCH] cgi explanation reademe layout --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 820b021..c7d2c5b 100644 --- a/README.md +++ b/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