From 8e2a1394be6d97fa3da922c27f335dac7a77132a Mon Sep 17 00:00:00 2001 From: "Adam C. Foltzer" Date: Wed, 21 Feb 2024 11:00:42 -0800 Subject: [PATCH] Add `http-response-status-invalid` error code I failed to notice this was missing in #52. Status codes outside the range of 100-599 are [invalid](https://www.rfc-editor.org/rfc/rfc9110#section-15-6), though there is a nod to implementation-defined behavior outside those valid ranges. In practice we have found it very useful to return error codes specific to status problems to customers since our platform does not support codes outside this range, and the next-best option in the RFC 9209 equivalents is the generic `http-protocol-error` which doesn't help a user much with debugging. --- imports.md | 21 +++++++++++++-------- proxy.md | 1 + wit/types.wit | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/imports.md b/imports.md index 5dff42a..5ed3aa0 100644 --- a/imports.md +++ b/imports.md @@ -665,6 +665,7 @@ https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table
  • HTTP-response-transfer-coding: option<string>
  • HTTP-response-content-coding: option<string>
  • HTTP-response-timeout
  • +
  • HTTP-response-status-invalid
  • HTTP-upgrade-failed
  • HTTP-protocol-error
  • loop-detected
  • @@ -810,11 +811,9 @@ http-related errors.

    which have multiple values are represented by multiple entries in this list with the same key.

    The tuple is a pair of the field key, represented as a string, and -Value, represented as a list of bytes. In a valid Fields, all keys -and values are valid UTF-8 strings. However, values are not always -well-formed, so they are represented as a raw list of bytes.

    -

    An error result will be returned if any header or value was -syntactically invalid, or if a header was forbidden.

    +Value, represented as a list of bytes.

    +

    An error result will be returned if any field-key or field-value is +syntactically invalid, or if a field is forbidden.

    Params

    [method]fields.get: func

    Get all of the values corresponding to a key. If the key is not present -in this fields, an empty list is returned. However, if the key is -present but empty, this is represented by a list with one or more -empty field-values present.

    +in this fields or is syntactically invalid, an empty list is returned. +However, if the key is present but empty, this is represented by a list +with one or more empty field-values present.

    Params