emerging-ezhttp
Releases (14)
-
0.21.0.0 indexed
-
0.20.0.0 unindexed
-
0.19.0.0 unindexed
-
0.18.0.0 unindexed
-
0.17.0.0 unindexed
-
0.16.0.0 unindexed
-
0.15.0.0 unindexed
-
0.14.0.0 unindexed
-
0.13.0.0 unindexed
-
0.12.0.0 unindexed
-
0.11.0.0 unindexed
-
0.10.0.0 unindexed
-
0.9.0.0 invalid
expected a fresh constructor name (duplicate declaration: Text)
-
0.8.0.0 invalid
expected a fresh constructor name (duplicate declaration: Text)
Definitions (909)
src/qs.bend
- def tok.pct1a character after `%` and a hex digit: a second hex digit makes the byte they name, anything else leaves `%` and the digit as written
- def tok.stepone character where the decoding stands
- def tok.endthe end of the text: an escape left open is written as it stands
- def toksa string as bytes and wide characters, character by character
- type Utfwhere the UTF-8 decoding stands: between characters, or inside a sequence with code point bits `cp` so far, needing a byte in lo..hi and `left` more continuation bytes after it
- type Leadwhat a byte between characters is: ASCII, the lead of a sequence (its bits, then what the sequence needs next), or a byte no sequence starts with
- def lead.f4F4: the last lead, up to U+10FFFF; F5 to FF lead nothing
- def lead.f1F1 to F3, else F4 and up
- def lead.f0F0 (no overlong four-byte form), else F1 and up
- def lead.eeEE and EF, else F0 and up
- def lead.edED (no surrogates), else EE and up
- def lead.e1E1 to EC, else ED and up
- def lead.e0E0 (no overlong three-byte form), else E1 and up
- def lead.twoC2 to DF, else E0 and up
- def lead.low80 to C1 (continuation bytes, overlong two-byte leads), else C2 and up
- def lead.asciiASCII, else 80 and up
- def leadwhat a byte between characters is (RFC 3629 §4, Unicode Table 3-7)
- def fffdU+FFFD REPLACEMENT CHARACTER
- def utf.adda continuation byte's six bits after the code point so far
- def utf.leada byte between characters, as its lead says
- def utf.idlea piece between characters
- def utf.morea continuation byte that fits: the character ends, or more are needed
- def utf.bytea byte inside a sequence: it continues it when it fits, else the sequence so far is one U+FFFD and the byte is read again between characters
- def utf.needa piece inside a sequence: a wide character ends it unfinished
- def utf.stepone piece where the decoding stands
- def utf.endthe end of the pieces: a sequence left unfinished is one U+FFFD
- def utf.decpieces as text, piece by piece
- def unquotepercent-decode a string, as urllib.parse.unquote
- def unquote.pluspercent-decode a string with `+` as a space, as urllib.parse.unquote_plus
- def plus.oneone character: a space as `+`, any other as quote_component writes it
- def quote.pluspercent-encode a string with a space as `+`, as urllib.parse.quote_plus
- def form.pairone name and value as `name=value`, both quote_plus'd
- def form.morethe pairs after the first, each after an `&`
- def urlencodepairs as a query string, as urllib.parse.urlencode
- def cut.pushone character put back in front of what the rest of the cut found
- def cut.atone character of the cut: the first `=` ends the text before it
- def cuta string cut at its first `=`: the text before it and the text after it, none when it holds no `=`
- def field.ofa field once it is cut: the name before its first `=` and the value after it, or all name and an empty value when it has no `=`
- def fieldone field as its name and value
- def fields.putone piece in front of the rest's fields, skipped when empty
- def fieldsthe pieces as fields, in order
- def parsea query string as its name and value pairs, as urllib.parse.parse_qsl(text, keep_blank_values=True)
- def get.pickthe value a later pair gives, else this pair's when it is named
- def getthe value of the last pair with this name, none when no pair has it
- def octets.toksoctets, one character each, as the pieces utf.dec reads
- def octets.textreceived octets as text: decoded as UTF-8, each ill-formed sequence's maximal subpart one U+FFFD (HTTP-QS-2)
- def octets.headersreceived header fields as text, name and value each decoded
src/redirect.bend
- type Hopwhat the client does after a response
- def redirect.maxthe most hops the client follows (httpx's default is 20)
- def redirect.iswhether a status asks the client to go elsewhere (RFC 9110 §15.4.2-9)
- def redirect.absolutewhether a Location is an absolute http or https URL
- def redirect.popthe segments kept so far, last first, with the last one dropped
- def redirect.dots.enda path that ends in `.` or `..` keeps its trailing `/`: an empty last segment
- def redirect.dots.upa segment that is not `.`: `..` drops the last kept, any other is kept
- def redirect.dots.oneone segment: `.` is dropped, `..` drops the last kept, any other is kept
- def redirect.dotsa path's segments with dot segments removed, `out` holding those kept so far, last first
- def redirect.cleanthe segments after a path's leading `/`, dot segments removed, as a path
- def redirect.init.ofevery segment but the last, after `s`
- def redirect.initevery segment but the last
- type Refa Location's path and its query (with its `?`, "" when it has none)
- def redirect.split.ofa Location divided at its first `?`
- def redirect.splita Location's path and query, its fragment dropped
- def redirect.abs.ofan absolute-path reference's path, dot segments removed, then its query
- def redirect.rel.ofa relative-path reference merged with the current path, dot segments removed, then its query
- def redirect.basea path without its query
- type Sortwhat sort of reference a Location that is not an absolute URL is
- def redirect.schemed.enda character that ends a reference's first segment
- def redirect.schemed.colona character that does not end the first segment: a `:` names a scheme
- def redirect.schemed.atone character of the scheme search
- def redirect.schemedwhether a reference names a scheme: a `:` before its first `/`, `?` or `#`
- def redirect.staysa Location the client does not follow: empty, a fragment, another scheme
- def redirect.sort.rela relative reference: a query, or a relative path
- def redirect.sort.staya reference that is not a path from the root: one the client stays on, or a relative one
- def redirect.sort.absa reference that is not a network path: an absolute path, or another
- def redirect.sort.ofthe sort, from what the Location starts with
- def redirect.sortwhat sort of reference a Location is
- def redirect.againsta Location of a known sort against the current URL's parts
- def redirect.ata Location against the current URL, once it is parsed
- def redirect.target.ofa Location once it is known whether it is an absolute URL
- def redirect.targetwhere a Location sends a client that is at `url`, or None when it is not one the client follows
- def redirect.hopa resolved target as a hop
- def redirect.ona response once it is known whether its status redirects
- def redirect.nextthe next hop from `url`, after a response with `status` and Location `loc` ("" when it had none), with `left` hops still allowed
- def redirect.planthe next hop after a response's status and headers
- def redirect.followswhether a request with this method follows redirects when asked to: only a GET does (method names are case-sensitive, RFC 9110 §9.1)
src/server.bend
- type Reqwhat a `_with` handler gets: the request as text (step.text) and its body's octets as they arrived (step.octets)
- type Answerwhat a `_with` handler answers: a text body (written as UTF-8), packed octets written unchanged, or a stream of octet chunks from a channel, written chunked until the channel is closed (SPEC.md HTTP-SRV-6, 7)
- def server.maxthe most octets one receive asks for
- def server.readsthe most receives one request takes
- def server.waithow long one accept waits before it is asked again, in ms
- def server.idleshow many idle accepts in a row a limited serve allows before it stops
- def server.pausehow long a failed accept waits before the next, so EMFILE does not spin
- def server.listenlisten on a host address and port, e.g.
- def server.accept.unaccept one connection, waiting at most server.wait() ms
- def server.accept
- def server.losea lost connection logs its line and closes
- def server.read.donethe request once it has all arrived (or the peer closed, or the receives ran out): its pieces put together and parsed
- def server.read.needswhat the request needs, kept once its head has ended
- def server.read.wholewhether as much has arrived as the request needs
- def server.read.moreoctets that arrived: stop when the request is whole, else read again