[{"id":"httpadvanced-001","courseId":"http-advanced","domain":"messages-and-syntax","topic":"Obsolete line folding","prompt":"A server receives a request whose header value continues on the next line, which starts with a space. The request is not wrapped in message/http. What must the server do?","hint":"Check what the spec allows a server to do with folding outside message/http.","explain":"Some header values were once continued over several lines that begin with whitespace. HTTP/1.1 deprecates that practice, so senders must not generate it, and receivers have strict duties when it arrives.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-5.2","interaction":{"type":"single"},"options":[{"id":"a","text":"Join the lines and drop the line break, adding no space","whyNot":"Folding must be replaced with SP or the request rejected; deleting the break with no space is not allowed."},{"id":"b","text":"Accept the value unchanged, since folding is valid in requests","whyNot":"Folding is deprecated, and outside message/http a server must not accept it unchanged."},{"id":"c","text":"Reject with 400, or replace each fold with a space before use","why":"The spec says a server MUST either reject the message with a 400 or replace each obs-fold with SP octets before interpreting the value."},{"id":"d","text":"Silently drop the continuation line and keep only the first line","whyNot":"Discarding the line is not one of the two permitted options; the server must reject the message or replace the fold with SP."}],"answer":"c","explanation":"Outside message/http, a server that receives obs-fold must either reject the message with 400 or replace each obs-fold with SP octets before interpreting the value.","concept":"Outside message/http, a server that receives obs-fold must either reject the message with 400 or replace each obs-fold with SP octets before interpreting the value.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","code":"X-Note: first part\n  continued here","takeaways":["Obsolete line folding is deprecated: never generate it, and never pass it through unchanged."]},{"id":"httpadvanced-002","courseId":"http-advanced","domain":"messages-and-syntax","topic":"Normal message parsing procedure","prompt":"A recipient parses an HTTP/1.1 message that has a body. Put these steps of the normal parsing procedure in order.","hint":"Some steps need data that an earlier step has already produced.","explain":"A body's length is not stated by the body itself. It is announced in the fields of the message, and how a reader handles the content depends on what those fields say.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-2.2","interaction":{"type":"sort","items":[{"text":"Read the start-line into a structure","why":"The start-line comes first in the message, so it is parsed before any header field."},{"text":"Read each header field line into a hash table by name, until the empty line","why":"Header lines follow the start-line and end at the blank line that closes the header section."},{"text":"Use the parsed data to decide whether a message body is expected","why":"Only once the header fields are parsed can the recipient tell whether a body follows."},{"text":"Read the body as a stream until its length is reached or the connection closes","why":"The body is read last, using the framing learned from the parsed fields."}]},"options":[],"answer":"o:abcd","explanation":"The normal procedure reads the start-line, then header field lines until the empty line, then uses the parsed data to decide whether a body is expected and reads it.","concept":"The normal procedure reads the start-line, then header field lines until the empty line, then uses the parsed data to decide whether a body is expected and reads it.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["The blank line ends the header section, and the body is parsed only after the headers."]},{"id":"httpadvanced-003","courseId":"http-advanced","domain":"messages-and-syntax","topic":"Close-delimited response body","prompt":"A client receives a response body and needs to know it was not cut short in transit. Which mechanism does HTTP/1.1 rely on to detect that the message is complete?","hint":"Think about how a recipient learns where a message body ends.","explain":"Bytes that stop arriving do not prove a body is whole, because a connection can end early. A reader needs some way to tell where the content is meant to end.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-6.3","interaction":{"type":"single"},"options":[{"id":"a","text":"Length-based or chunk-delimited message framing","why":"HTTP relies on length or chunk-delimited framing to detect completeness, since it defines no specific integrity mechanism."},{"id":"b","text":"A checksum field that HTTP defines for each body","whyNot":"HTTP does not define a specific mechanism for ensuring message integrity."},{"id":"c","text":"The server closing the connection after the last byte","whyNot":"Connection closure can be used to truncate messages, so closing alone cannot show that the body is complete."},{"id":"d","text":"Using https, whose encryption prevents any truncation","whyNot":"https protects against modification, but care is still needed so that connection closure cannot truncate messages."}],"answer":"a","explanation":"HTTP defines no specific integrity mechanism and instead detects completeness through length or chunk-delimited framing.","concept":"HTTP defines no specific integrity mechanism and instead detects completeness through length or chunk-delimited framing.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Completeness comes from declared length or chunk framing, not from a checksum or from connection closure."]},{"id":"httpadvanced-004","courseId":"http-advanced","domain":"messages-and-syntax","topic":"Asterisk-form request target","prompt":"A monitoring client wants OPTIONS for the whole server, not for one resource on it. Which request-target must the client send?","hint":"One request-target form is reserved for requests about the server as a whole.","explain":"A request-target usually names one resource. A special form exists for requests about the server itself, and the spec limits where it may be used.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2.4","interaction":{"type":"single"},"options":[{"id":"a","text":"/","whyNot":"/ names the root resource, and the spec says a server-wide OPTIONS request uses only '*'."},{"id":"b","text":"*","why":"The client MUST send only '*' as the request-target when it asks for OPTIONS for the server as a whole."},{"id":"c","text":"http://monitor.example:8001","whyNot":"The client must send only '*'; a proxy rewrites an absolute-form OPTIONS target to '*' when it forwards the request."},{"id":"d","text":"/*","whyNot":"The client must send only '*', so a path or other characters may not be added to it."}],"answer":"b","explanation":"The asterisk-form request-target '*' is used only for a server-wide OPTIONS request, and the client MUST send only '*' in that case.","concept":"The asterisk-form request-target '*' is used only for a server-wide OPTIONS request, and the client MUST send only '*' in that case.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Server-wide OPTIONS uses '*' as the request-target, not '/'."]},{"id":"httpadvanced-005","courseId":"http-advanced","domain":"messages-and-syntax","topic":"Authority-form request target","prompt":"A client needs a tunnel through a proxy, so it sends a CONNECT request. Which request line uses the authority-form that the spec requires for CONNECT?","hint":"Think about what the target of a CONNECT request must contain.","explain":"A request-target has several forms, each for a different kind of request. The form CONNECT uses is narrower than a general URI authority, so it follows a stricter pattern.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2.3","interaction":{"type":"single"},"options":[{"id":"a","text":"CONNECT www.example.com HTTP/1.1","whyNot":"The host:port format is required for CONNECT, so a target with no port is not authority-form."},{"id":"b","text":"CONNECT https://www.example.com:443 HTTP/1.1","whyNot":"A URI with a scheme is not the host:port authority-form that CONNECT requires."},{"id":"c","text":"CONNECT /www.example.com:443 HTTP/1.1","whyNot":"The authority-form is host:port with no leading slash, so a path-like target does not match it."},{"id":"d","text":"CONNECT www.example.com:443 HTTP/1.1","why":"The authority-form used by CONNECT is the specific host:port format, so this target matches it."}],"answer":"d","explanation":"The authority-form used by CONNECT is the specific host:port format, so the port is required, unlike the general URI authority where it is optional.","concept":"The authority-form used by CONNECT is the specific host:port format, so the port is required, unlike the general URI authority where it is optional.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["A CONNECT target must be host:port; a bare host without a port does not match the authority-form."]}]