[{"id":"httpintermediate-001","courseId":"http-intermediate","domain":"messages-and-syntax","topic":"Absolute-form request target for proxies","prompt":"A server rebuilds a full URI from the parts it has determined. Put these parts in the order they are joined into an absolute-URI.","hint":"Think about how a full web address is written, from its start to its end.","explain":"When a request target is not in absolute-form, the server builds the full target URI itself from the connection and the request. Each piece then takes a fixed place in the final address.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-3.2.2","interaction":{"type":"sort","items":[{"text":"scheme","why":"The scheme, such as http or https, opens the URI before anything else."},{"text":"://","why":"The separator sits between the scheme and the authority."},{"text":"authority","why":"The host, and any port, follows the separator."},{"text":"combined path and query","why":"The path and query come last, after the authority they belong to."}]},"options":[],"answer":"o:abcd","explanation":"A reconstructed target URI is built by concatenating the scheme, '://', the authority, and the combined path and query component.","concept":"A reconstructed target URI is built by concatenating the scheme, '://', the authority, and the combined path and query component.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Proxies and origin servers take the host from an absolute-form target and ignore the received Host header."]},{"id":"httpintermediate-002","courseId":"http-intermediate","domain":"messages-and-syntax","topic":"Chunked transfer coding","prompt":"In HTTP/1.1, a sender has a message body that is already chunked and wants to apply chunked coding to it again. What does RFC 9112 allow?","hint":"Look for a rule about how many times one transfer coding may be applied to a body.","explain":"Transfer codings change how a message body is framed on the wire. Chunked framing lets the receiver find the end of a body whose length was not known in advance.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-7.1","interaction":{"type":"single"},"options":[{"id":"a","text":"Not allowed: a message body must not get chunked more than once","why":"A sender MUST NOT apply the chunked transfer coding more than once to a message body."},{"id":"b","text":"Allowed, if Content-Length is also set to the body size","whyNot":"Content-Length does not make a second chunked layer legal; the sender must not chunk an already chunked body."},{"id":"c","text":"Allowed, if Content-Encoding marks the inner layer","whyNot":"Content-Encoding describes the representation; it cannot authorize a second chunked transfer coding."},{"id":"d","text":"Allowed in responses, but not in requests","whyNot":"The rule covers message bodies in general; it is not limited to requests or to responses."}],"answer":"a","explanation":"A sender MUST NOT apply the chunked transfer coding more than once to a message body.","concept":"A sender MUST NOT apply the chunked transfer coding more than once to a message body.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["In a request, chunked must be the last transfer coding, and it may appear only once."]},{"id":"httpintermediate-003","courseId":"http-intermediate","domain":"messages-and-syntax","topic":"Transfer-Encoding overriding Content-Length","prompt":"A sender may include a Content-Length header in a request that also carries Transfer-Encoding, because the receiver lets Transfer-Encoding win.","hint":"Ask who the override rule applies to: the party that sends the message or the one that receives it.","explain":"Two framing headers can both describe where a message body ends. The spec says which one wins when both arrive, and it also limits what a sender may put in its own message.","source":"https://www.rfc-editor.org/rfc/rfc9112.html#section-6.3","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"Wrong: a sender must not send Content-Length with Transfer-Encoding at all; the override rule only tells receivers what to do."},{"id":"b","text":"False","why":"Right: senders MUST NOT send Content-Length in a message with Transfer-Encoding, even though receivers let Transfer-Encoding win."}],"answer":"b","explanation":"A sender MUST NOT send a Content-Length header field in any message that contains a Transfer-Encoding header field.","concept":"A sender MUST NOT send a Content-Length header field in any message that contains a Transfer-Encoding header field.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Never send Content-Length with Transfer-Encoding; receivers may still see both from old software."]},{"id":"httpintermediate-004","courseId":"http-intermediate","domain":"messages-and-syntax","topic":"Trailer header","prompt":"A server wants to send Server-Timing after a chunked response body. Which TWO statements about HTTP trailers are correct?","hint":"Think about what browsers and page scripts do with fields that arrive after the body.","explain":"A trailer is a set of header fields sent after the body of a chunked message. Which fields are allowed there, and which code can read them, are both limited.","source":"https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Trailer","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"Browsers ignore HTTP trailers, with Server-Timing as the exception","why":"Browsers mostly drop trailers, but Server-Timing trailers can still appear in developer tools."},{"id":"b","text":"Fetch and XHR code cannot read HTTP trailers","why":"Developers cannot access trailers through the Fetch API or XHR, so page scripts never see them."},{"id":"c","text":"Content-Length can be listed in Trailer to report the final size","whyNot":"Message framing headers such as Content-Length are on the disallowed list for Trailer."},{"id":"d","text":"Set-Cookie can be sent as a trailer to set a cookie after the body","whyNot":"Authentication headers such as Set-Cookie are disallowed in Trailer."},{"id":"e","text":"A trailer can be sent on a response that has Content-Length and no chunking","whyNot":"Trailers are fields sent at the end of chunked messages, not of unchunked ones."},{"id":"f","text":"Servers send TE: trailers, because TE is a response header","whyNot":"TE is a request header; the client sends it to say that trailer fields are allowed."}],"answer":"ab","explanation":"Trailers ride at the end of chunked messages; browsers mostly ignore them, Server-Timing excepted, and Fetch and XHR cannot read them.","concept":"Trailers ride at the end of chunked messages; browsers mostly ignore them, Server-Timing excepted, and Fetch and XHR cannot read them.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Browsers and Fetch or XHR code ignore most trailers, so do not rely on them for data the page needs."]},{"id":"httpintermediate-005","courseId":"http-intermediate","domain":"messages-and-syntax","topic":"Expect 100-continue","prompt":"A server refuses a request on HTTP/1.1 because the client must switch to another protocol first. It replies 426 Upgrade Required. Which header must that response include?","hint":"Look at what the server asks the client to change before it will answer.","explain":"A 4xx status can mean the server refuses the request as it stands, while still being willing to serve it later. Some of these responses must carry a header that names what the client needs.","source":"https://www.rfc-editor.org/rfc/rfc9110.html#section-10.1.1","interaction":{"type":"single"},"options":[{"id":"a","text":"Upgrade, naming the protocol the client must switch to","why":"A 426 response MUST include an Upgrade header field that names the protocol the server requires."},{"id":"b","text":"Location, with the address of the upgraded endpoint","whyNot":"Location points to another URL; a 426 names a protocol, so Upgrade is the required field."},{"id":"c","text":"Retry-After, with the number of seconds to wait","whyNot":"Retry-After is only a suggestion on 503 responses; it is not what a 426 must carry."},{"id":"d","text":"Set-Cookie, with a new session identifier","whyNot":"Nothing in the 426 rule asks for cookies; the one field it requires is Upgrade."}],"answer":"a","explanation":"A 426 Upgrade Required response MUST include an Upgrade header field naming the protocol or protocols the server requires.","concept":"A 426 Upgrade Required response MUST include an Upgrade header field naming the protocol or protocols the server requires.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["A 426 response asks the client to change protocol; its Upgrade header names the protocol to switch to."]}]