zuse: add parsers for http header field values

Multi-value format as used by some headers.

Also updates pill with recent zuse changes.
This commit is contained in:
Fang 2020-05-31 17:36:47 +02:00
parent b1daaec7bf
commit a87000149d
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
2 changed files with 41 additions and 2 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5a22f2797c2cbbff171cb0a4c14afaca4353f41f49f1fcdc5f5dbf3e8056a7e3
size 13813374
oid sha256:960df352aa78135a409e87d0946bf2665605bf3918c19e3e290ad40edb740769
size 17295261

View File

@ -357,6 +357,45 @@
t.header-list
::
[i.header-list $(header-list t.header-list)]
:: +unpack-header: parse header field values
::
++ unpack-header
|^ |= value=@t
^- (unit (list (map @t @t)))
(rust (cass (trip value)) values)
::
++ values
%+ more
(ifix [. .]:(star ;~(pose ace (just '\09'))) com)
pairs
::
++ pairs
%+ cook
~(gas by *(map @t @t))
%+ more (ifix [. .]:(star ace) mic)
;~(plug token ;~(pose ;~(pfix tis value) (easy '')))
::
++ value
;~(pose token quoted-string)
::
++ token :: 7230 token
%+ cook crip
::NOTE this is ptok:de-purl:html, but can't access that here
%- plus
;~ pose
aln zap hax bus cen pad say tar lus
hep dot ket cab tec bar sig
==
::
++ quoted-string :: 7230 quoted string
%+ cook crip
%+ ifix [. .]:;~(less (jest '\\"') yel)
%- star
;~ pose
;~(pfix bat ;~(pose (just '\09') ace prn))
;~(pose (just '\09') ;~(less (mask "\22\5c\7f") (shim 0x20 0xff)))
==
--
:: +simple-payload: a simple, one event response used for generators
::
+$ simple-payload