diff --git a/.spec-results b/.spec-results index 5a8c810..926ec7d 100644 --- a/.spec-results +++ b/.spec-results @@ -2,119 +2,119 @@ [ "Axon Header Typed Accept Aac does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Aac parses \"audio/aac\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Abw does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Abw parses \"application/x-abiword\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Arc does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Arc parses \"application/x-freearc\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Archive7z does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Archive7z parses \"application/x-7z-compressed\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Avi does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Avi parses \"video/x-msvideo\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Avif does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Avif parses \"image/avif\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Azw does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Azw parses \"application/vnd.amazon.ebook\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Bin does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Bin parses \"application/octet-stream\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Bmp does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -128,252 +128,252 @@ [ "Axon Header Typed Accept Bmp parses \"image/bmp\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Bz does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Bz parses \"application/x-bzip\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Bz2 does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Bz2 parses \"application/x-bzip2\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Cda does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Cda parses \"application/x-cdf\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Csh does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Csh parses \"application/x-csh\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Css does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Css parses \"text/css\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Csv does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Csv parses \"text/csv\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Doc does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Doc parses \"application/msword\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Docx does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Docx parses \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Eot does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Eot parses \"application/vnd.ms-fontobject\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Epub does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Epub parses \"application/epub+zip\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Gif does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Gif parses \"image/gif\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Gz does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Gz parses \"application/gzip\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Html does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Html parses \"text/html\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ico does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ico parses \"image/vnd.microsoft.icon\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ics does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ics parses \"text/calendar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Jar does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Jar parses \"application/java-archive\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Jpeg does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Jpeg parses \"image/jpeg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Js does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -387,77 +387,77 @@ [ "Axon Header Typed Accept Js parses \"text/javascript\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Json does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Json parses \"application/json\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Jsonld does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Jsonld parses \"application/ld+json\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept MIME.MIME parses \"application/json\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept MIME.MIME parses \"foo\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept MIME.MIME parses \"text/plain\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept MIME.MIME parses \"text/plain;charset=utf8\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Midi does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Midi parses \"audio/midi\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -478,294 +478,294 @@ [ "Axon Header Typed Accept Mp3 does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Mp3 parses \"audio/mpeg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Mp4 does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Mp4 parses \"video/mp4\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Mpeg does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Mpeg parses \"video/mpeg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Mpkg does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Mpkg parses \"application/vnd.apple.installer+xml\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Odp does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Odp parses \"application/vnd.oasis.opendocument.presentation\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ods does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ods parses \"application/vnd.oasis.opendocument.spreadsheet\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Odt does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Odt parses \"application/vnd.oasis.opendocument.text\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Oga does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Oga parses \"audio/ogg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ogv does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ogv parses \"video/ogg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ogx does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ogx parses \"application/ogg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Opus does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Opus parses \"audio/opus\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Otf does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Otf parses \"font/otf\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Pdf does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Pdf parses \"application/pdf\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Php does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Php parses \"application/x-httpd-php\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Png does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Png parses \"image/png\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ppt does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ppt parses \"application/vnd.ms-powerpoint\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Pptx does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Pptx parses \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Rar does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Rar parses \"application/vnd.rar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Rtf does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Rtf parses \"application/rtf\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Sh does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Sh parses \"application/x-sh\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept String parses \"\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept String parses \"foo\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -779,336 +779,336 @@ [ "Axon Header Typed Accept Svg does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Svg parses \"image/svg+xml\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Tar does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Tar parses \"application/x-tar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Tif does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Tif parses \"image/tiff\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ts does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ts parses \"video/mp2t\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ttf does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Ttf parses \"font/ttf\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Txt does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Txt parses \"text/plain\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Video3g2 does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Video3g2 parses \"video/3gpp2\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Video3gp does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Video3gp parses \"video/3gpp\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Vsd does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Vsd parses \"application/vnd.visio\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Wav does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Wav parses \"audio/wav\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Weba does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Weba parses \"audio/webm\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Webm does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Webm parses \"video/webm\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Webp does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Webp parses \"image/webp\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Woff does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Woff parses \"font/woff\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Woff2 does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Woff2 parses \"font/woff2\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Xhtml does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Xhtml parses \"application/xhtml+xml\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Xls does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Xls parses \"application/vnd.ms-excel\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Xlsx does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Xlsx parses \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Xml does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Xml parses \"application/xml\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Xul does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Xul parses \"application/vnd.mozilla.xul+xml\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Zip does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Accept Zip parses \"application/zip\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowCredentials does not parse \"\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowCredentials does not parse \"false\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowCredentials parses \"true\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowHeaders does not parse \" Vary\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowHeaders does not parse \"Vary \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowHeaders parses \" * \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1129,21 +1129,21 @@ [ "Axon Header Typed AccessControlAllowHeaders parses \"* \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowHeaders parses \"*\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowHeaders parses \"Accept, Vary, Content-Type\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1157,28 +1157,28 @@ [ "Axon Header Typed AccessControlAllowHeaders parses \"Vary\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowHeaders parses \"Vary, \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowMethods does not parse \" GET , PATCH \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowMethods does not parse \"get\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1192,28 +1192,28 @@ [ "Axon Header Typed AccessControlAllowMethods parses \" * \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowMethods parses \"* \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowMethods parses \"*\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowMethods parses \"GET\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1234,7 +1234,7 @@ [ "Axon Header Typed AccessControlAllowMethods parses \"GET,,,,,, PATCH\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1248,49 +1248,49 @@ [ "Axon Header Typed AccessControlAllowOrigin parses \" foo \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowOrigin parses \" * \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowOrigin parses \"* \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowOrigin parses \"*\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowOrigin parses \"foo\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlAllowOrigin parses \"https://example.com\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlExposeHeaders parses \" * \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1311,105 +1311,105 @@ [ "Axon Header Typed AccessControlExposeHeaders parses \"* \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlExposeHeaders parses \"*\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlExposeHeaders parses \"Accept, Vary, Content-Type\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlExposeHeaders parses \"Vary \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlExposeHeaders parses \"Vary\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlMaxAge parses \" 0\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlMaxAge parses \" 123 \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlMaxAge parses \"23190\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlRequestHeaders parses \" Vary \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlRequestHeaders parses \" Vary\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlRequestHeaders parses \"Accept, Vary, Content-Type\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlRequestHeaders parses \"Vary\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlRequestMethod does not parse \" PATCH \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlRequestMethod does not parse \"PATCh\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed AccessControlRequestMethod does not parse \"get\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1430,7 +1430,7 @@ [ "Axon Header Typed AccessControlRequestMethod parses \"GET\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1444,35 +1444,35 @@ [ "Axon Header Typed Age parses \" 0\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Age parses \" 123 \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Age parses \"23190\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Allow does not parse \" GET , PATCH \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Allow does not parse \"get\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1486,21 +1486,21 @@ [ "Axon Header Typed Allow parses \"GET\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Allow parses \"GET, PATCH\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Allow parses \"GET,,,,,, , , ,PATCH\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1542,14 +1542,14 @@ [ "Axon Header Typed Authorization does not parse \" Bing bar \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Authorization does not parse \" Bing bar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1577,84 +1577,84 @@ [ "Axon Header Typed Authorization parses \"Bar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Authorization parses \"Bing bar \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Authorization parses \"Bing bar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Authorization parses \"Foo bar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed BasicAuth does not parse \"Basic foo\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed BasicAuth does not parse \"Bearer ZGVtbzpwQDU1dzByZA==\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed BasicAuth parses \"Basic ZGVtbzpwQDU1dzByZA==\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed BearerAuth does not parse \"Basic foo\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed BearerAuth parses \"Bearer foo \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed BearerAuth parses \"Bearer foo\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed CacheControl does not parse \" \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed CacheControl does not parse \" foo \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1668,7 +1668,7 @@ [ "Axon Header Typed CacheControl does not parse \" max-age=604800\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1689,7 +1689,7 @@ [ "Axon Header Typed CacheControl does not parse \"foo=bar \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1703,7 +1703,7 @@ [ "Axon Header Typed CacheControl does not parse \"max-age=604800 \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1724,56 +1724,56 @@ [ "Axon Header Typed CacheControl parses \"\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed CacheControl parses \"foo\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed CacheControl parses \"foo=bar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed CacheControl parses \"max-age=20, s-maxage=10, no-cache, must-revalidate, proxy-revalidate, no-store, private, public, must-understand, no-transform, immutable, stale-while-revalidate, stale-if-error\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed CacheControl parses \"max-age=604800\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed CacheControl parses \"max-age=604800, must-revalidate\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Connection does not parse \" \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Connection does not parse \"\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1787,21 +1787,21 @@ [ "Axon Header Typed Connection parses \" a , b , c,d\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Connection parses \" cLoSe \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Connection parses \" close \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -1815,14 +1815,28 @@ [ "Axon Header Typed Connection parses \"close\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Connection parses \"fuaiowf\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", + "success": true + } + ], + [ + "Axon Header Typed ContentDisposition does not parse \" attachment; filename=\\\"foo.txt\\\" \"", + { + "timestamp": "1739384771309.0", + "success": true + } + ], + [ + "Axon Header Typed ContentDisposition does not parse \" form-data; filename=\\\"foo.txt\\\" ; name=\\\"foo\\\" \"", + { + "timestamp": "1739384771309.0", "success": true } ], @@ -1843,1211 +1857,1211 @@ [ "Axon Header Typed ContentDisposition parses \" inline \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentDisposition parses \"attachment\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentDisposition parses \"attachment; filename=\\\"foo.txt\\\"\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentDisposition parses \"form-data\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentDisposition parses \"form-data; filename=\\\"foo.txt\\\"\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentDisposition parses \"form-data; name=\\\"foo\\\"\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentDisposition parses \"inline \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentDisposition parses \"inline\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentEncoding parses \" gzip \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentEncoding parses \" gzip , deflate \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentEncoding parses \"gzip\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentLength parses \" 0 \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentLength parses \" 1 \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentLength parses \" 1212943817 \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentLocation parses \" a \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentLocation parses \"\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentLocation parses \"a\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentLocation parses \"abc\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentRange parses \" bytes 0-10/* \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentRange parses \" bytes */10 \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentRange parses \" bytes 0-0/0 \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentRange parses \" bytes 0-10/10 \"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentRange parses \"bytes */10\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentRange parses \"bytes 0-10/*\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentRange parses \"bytes 0-10/10\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Aac does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Aac parses \"audio/aac\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Abw does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Abw parses \"application/x-abiword\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Arc does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Arc parses \"application/x-freearc\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Archive7z does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Archive7z parses \"application/x-7z-compressed\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Avi does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Avi parses \"video/x-msvideo\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Avif does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Avif parses \"image/avif\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Azw does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Azw parses \"application/vnd.amazon.ebook\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Bin does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Bin parses \"application/octet-stream\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Bmp does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Bmp parses \"image/bmp\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Bz does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Bz parses \"application/x-bzip\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Bz2 does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Bz2 parses \"application/x-bzip2\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Cda does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Cda parses \"application/x-cdf\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Csh does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Csh parses \"application/x-csh\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Css does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Css parses \"text/css\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Csv does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Csv parses \"text/csv\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Doc does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Doc parses \"application/msword\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Docx does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Docx parses \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Eot does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Eot parses \"application/vnd.ms-fontobject\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Epub does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Epub parses \"application/epub+zip\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Gif does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Gif parses \"image/gif\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Gz does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Gz parses \"application/gzip\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Html does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Html parses \"text/html\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ico does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ico parses \"image/vnd.microsoft.icon\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ics does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ics parses \"text/calendar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Jar does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Jar parses \"application/java-archive\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Jpeg does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Jpeg parses \"image/jpeg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Js does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Js parses \"text/javascript\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Json does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Json parses \"application/json\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Jsonld does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Jsonld parses \"application/ld+json\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType MIME.MIME parses \"application/json\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType MIME.MIME parses \"foo\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType MIME.MIME parses \"text/plain\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType MIME.MIME parses \"text/plain;charset=utf8\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Midi does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Midi parses \"audio/midi\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Mp3 does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Mp3 parses \"audio/mpeg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Mp4 does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Mp4 parses \"video/mp4\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Mpeg does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Mpeg parses \"video/mpeg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Mpkg does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Mpkg parses \"application/vnd.apple.installer+xml\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Odp does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Odp parses \"application/vnd.oasis.opendocument.presentation\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ods does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ods parses \"application/vnd.oasis.opendocument.spreadsheet\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Odt does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Odt parses \"application/vnd.oasis.opendocument.text\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Oga does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Oga parses \"audio/ogg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ogv does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ogv parses \"video/ogg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ogx does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ogx parses \"application/ogg\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Opus does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Opus parses \"audio/opus\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Otf does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Otf parses \"font/otf\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Pdf does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Pdf parses \"application/pdf\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Php does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Php parses \"application/x-httpd-php\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Png does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Png parses \"image/png\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ppt does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ppt parses \"application/vnd.ms-powerpoint\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Pptx does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Pptx parses \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Rar does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Rar parses \"application/vnd.rar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Rtf does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Rtf parses \"application/rtf\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Sh does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Sh parses \"application/x-sh\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType String parses \"\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType String parses \"foo\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Svg does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Svg parses \"image/svg+xml\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Tar does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Tar parses \"application/x-tar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Tif does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Tif parses \"image/tiff\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ts does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ts parses \"video/mp2t\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ttf does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Ttf parses \"font/ttf\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Txt does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Txt parses \"text/plain\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Video3g2 does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Video3g2 parses \"video/3gpp2\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Video3gp does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Video3gp parses \"video/3gpp\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Vsd does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Vsd parses \"application/vnd.visio\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Wav does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Wav parses \"audio/wav\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Weba does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Weba parses \"audio/webm\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Webm does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Webm parses \"video/webm\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Webp does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Webp parses \"image/webp\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Woff does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Woff parses \"font/woff\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Woff2 does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Woff2 parses \"font/woff2\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Xhtml does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Xhtml parses \"application/xhtml+xml\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Xls does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Xls parses \"application/vnd.ms-excel\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Xlsx does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Xlsx parses \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Xml does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Xml parses \"application/xml\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Xul does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Xul parses \"application/vnd.mozilla.xul+xml\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Zip does not parse \"unknown\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed ContentType Zip parses \"application/zip\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -3082,98 +3096,112 @@ [ "Axon Header Typed Cookie parses \"foo=\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Cookie parses \"foo=bar\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Cookie parses \"foo=bar; baz=\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Header Typed Cookie parses \"foo=bar; baz=quux\"", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", + "success": true + } + ], + [ + "Axon Request Handler responds not found", + { + "timestamp": "1739384771309.0", + "success": true + } + ], + [ + "Axon Request Handler responds ok", + { + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Request Parts Body extracts a JSON body", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Request Parts Body extracts a string body from a buffer", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Request Parts Body extracts a string body from a cached string", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Request Parts Body extracts a string body from a readable stream", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Request Parts Path ... but does if ends in IgnoreRest", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Request Parts Path does not partially match a route ...", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Request Parts Path extracts an int", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Request Parts Path extracts an int and a string", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Request Parts Path matches a route matching literal", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], [ "Axon Request Parts Path matches a route matching multiple literals", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -3208,7 +3236,7 @@ [ "Axon Request Parts extracts header, method, path, JSON body", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", "success": true } ], @@ -3222,7 +3250,14 @@ [ "Axon Request Parts extracts the whole request", { - "timestamp": "1733418667483.0", + "timestamp": "1739384771309.0", + "success": true + } + ], + [ + "Axon Request a responds ok", + { + "timestamp": "1739384370625.0", "success": true } ], diff --git a/spago.yaml b/spago.yaml index 8b2a702..79774b7 100644 --- a/spago.yaml +++ b/spago.yaml @@ -3,34 +3,34 @@ package: dependencies: - b64 - parsing - - aff: ">=8.0.0 <9.0.0" - - argonaut-codecs: ">=9.1.0 <10.0.0" - - argonaut-core: ">=7.0.0 <8.0.0" - - arraybuffer-types: ">=3.0.2 <4.0.0" - - arrays: ">=7.3.0 <8.0.0" - - bifunctors: ">=6.0.0 <7.0.0" - - console: ">=6.1.0 <7.0.0" - - control: ">=6.0.0 <7.0.0" - - effect: ">=4.0.0 <5.0.0" - - either: ">=6.1.0 <7.0.0" - - exceptions: ">=6.1.0 <7.0.0" - - foldable-traversable: ">=6.0.0 <7.0.0" - - integers: ">=6.0.0 <7.0.0" - - maybe: ">=6.0.0 <7.0.0" - - newtype: ">=5.0.0 <6.0.0" - - node-buffer: ">=9.0.0 <10.0.0" - - node-net: ">=5.1.0 <6.0.0" - - node-streams: ">=9.0.0 <10.0.0" - - nullable: ">=6.0.0 <7.0.0" - - ordered-collections: ">=3.2.0 <4.0.0" - - prelude: ">=6.0.1 <7.0.0" - - refs: ">=6.0.0 <7.0.0" - - strings: ">=6.0.1 <7.0.0" - - transformers: ">=6.1.0 <7.0.0" - - tuples: ">=7.0.0 <8.0.0" - - typelevel-prelude: ">=7.0.0 <8.0.0" - - url-immutable: ">=1.0.0 <2.0.0" - - web-streams: ">=4.0.0 <5.0.0" + - aff: '>=8.0.0 <9.0.0' + - argonaut-codecs: '>=9.1.0 <10.0.0' + - argonaut-core: '>=7.0.0 <8.0.0' + - arraybuffer-types: '>=3.0.2 <4.0.0' + - arrays: '>=7.3.0 <8.0.0' + - bifunctors: '>=6.0.0 <7.0.0' + - console: '>=6.1.0 <7.0.0' + - control: '>=6.0.0 <7.0.0' + - effect: '>=4.0.0 <5.0.0' + - either: '>=6.1.0 <7.0.0' + - exceptions: '>=6.1.0 <7.0.0' + - foldable-traversable: '>=6.0.0 <7.0.0' + - integers: '>=6.0.0 <7.0.0' + - maybe: '>=6.0.0 <7.0.0' + - newtype: '>=5.0.0 <6.0.0' + - node-buffer: '>=9.0.0 <10.0.0' + - node-net: '>=5.1.0 <6.0.0' + - node-streams: '>=9.0.0 <10.0.0' + - nullable: '>=6.0.0 <7.0.0' + - ordered-collections: '>=3.2.0 <4.0.0' + - prelude: '>=6.0.1 <7.0.0' + - refs: '>=6.0.0 <7.0.0' + - strings: '>=6.0.1 <7.0.0' + - transformers: '>=6.1.0 <7.0.0' + - tuples: '>=7.0.0 <8.0.0' + - typelevel-prelude: '>=7.0.0 <8.0.0' + - url-immutable: '>=1.0.0 <2.0.0' + - web-streams: '>=4.0.0 <5.0.0' test: main: Test.Main dependencies: diff --git a/src/Axon.Header.Typed.purs b/src/Axon.Header.Typed.purs index 9d39f6a..84676ad 100644 --- a/src/Axon.Header.Typed.purs +++ b/src/Axon.Header.Typed.purs @@ -51,26 +51,26 @@ import Type.MIME as Type.MIME -- TODO: this is fine, probably switch to a tokenizer at some point. parsing headers is also probably a solved problem rules :: - { char :: Parser String String - , upAlpha :: Parser String String - , loAlpha :: Parser String String - , alpha :: Parser String String - , digit :: Parser String String - , ctl :: Parser String String - , cr :: Parser String String - , lf :: Parser String String - , sp :: Parser String String - , ht :: Parser String String - , dquote :: Parser String String - , crlf :: Parser String String - , lws :: Parser String String - , text :: Parser String String - , separators :: Parser String String - , token :: Parser String String - , quoted :: Parser String String - , cookieChar :: Parser String String - , token68 :: Parser String String - } + { char :: Parser String String + , upAlpha :: Parser String String + , loAlpha :: Parser String String + , alpha :: Parser String String + , digit :: Parser String String + , ctl :: Parser String String + , cr :: Parser String String + , lf :: Parser String String + , sp :: Parser String String + , ht :: Parser String String + , dquote :: Parser String String + , crlf :: Parser String String + , lws :: Parser String String + , text :: Parser String String + , separators :: Parser String String + , token :: Parser String String + , quoted :: Parser String String + , cookieChar :: Parser String String + , token68 :: Parser String String + } rules = let un (Left e) = unsafeCrashWith e @@ -89,40 +89,48 @@ rules = crlf = un $ Parse.regex "\\x0d\\x0a" Regex.Flags.noFlags lws = Parse.optional crlf *> Parse.many1 (Parse.try sp <|> ht) <#> fold text = un $ Parse.regex "\\x20|\\x09|[^\\x00-\\x1f]" Regex.Flags.noFlags - separators = un $ Parse.regex "[()<>@,;:\\\\\"\\/\\[\\]?={}\\x20\\x09]" Regex.Flags.noFlags - token = un $ Parse.regex "[^\\x00-\\x1f()<>@,;:\\\\\"\\/\\[\\]?={}\\x20\\x09]+" Regex.Flags.noFlags + separators = un $ Parse.regex "[()<>@,;:\\\\\"\\/\\[\\]?={}\\x20\\x09]" + Regex.Flags.noFlags + token = un $ Parse.regex + "[^\\x00-\\x1f()<>@,;:\\\\\"\\/\\[\\]?={}\\x20\\x09]+" + Regex.Flags.noFlags quoted = un $ Parse.regex "\"(.*)(? a) $ Regex.regex "(^\\s*\")|(\"\\s*$)" Regex.Flags.global +quotesRe = unsafePartial $ (\(Right a) -> a) $ Regex.regex "(^\\s*\")|(\"\\s*$)" + Regex.Flags.global datetimeParser :: Parser String DateTime datetimeParser = @@ -130,28 +138,64 @@ datetimeParser = as :: forall a. String -> a -> Parser String a as s a = Parse.string s $> a - weekday = Parse.choice [as "Mon" Monday, as "Tue" Tuesday, as "Wed" Wednesday, as "Thu" Thursday, as "Fri" Friday, as "Sat" Saturday, as "Sun" Sunday] - month = Parse.choice [as "Jan" January, as "Feb" February, as "Mar" March, as "Apr" April, as "May" May, as "Jun" June, as "Jul" July, as "Aug" August, as "Sep" September, as "Oct" October, as "Nov" November, as "Dec" December] + weekday = Parse.choice + [ as "Mon" Monday + , as "Tue" Tuesday + , as "Wed" Wednesday + , as "Thu" Thursday + , as "Fri" Friday + , as "Sat" Saturday + , as "Sun" Sunday + ] + month = Parse.choice + [ as "Jan" January + , as "Feb" February + , as "Mar" March + , as "Apr" April + , as "May" May + , as "Jun" June + , as "Jul" July + , as "Aug" August + , as "Sep" September + , as "Oct" October + , as "Nov" November + , as "Dec" December + ] day = Parse.intDecimal <#> toEnum >>= Parse.liftMaybe (const "invalid day") - year = Parse.intDecimal <#> toEnum >>= Parse.liftMaybe (const "invalid year") + year = Parse.intDecimal <#> toEnum >>= Parse.liftMaybe + (const "invalid year") date = ( pure (\d m y -> Date.exactDate y m d) <*> (weekday *> Parse.whiteSpace *> day) - <*> (Parse.whiteSpace *> month) <*> (Parse.whiteSpace *> year) + <*> (Parse.whiteSpace *> month) + <*> (Parse.whiteSpace *> year) ) - >>= Parse.liftMaybe (const "invalid date") + >>= Parse.liftMaybe (const "invalid date") time = ( pure (\h m s ms -> Time.Time h m s ms) - <*> ((Parse.intDecimal <#> toEnum >>= Parse.liftMaybe (const "invalid hour"))) - <*> (Parse.string ":" *> (Parse.intDecimal <#> toEnum >>= Parse.liftMaybe (const "invalid minutes"))) - <*> (Parse.string ":" *> (Parse.intDecimal <#> toEnum >>= Parse.liftMaybe (const "invalid seconds"))) + <*> + ( ( Parse.intDecimal <#> toEnum >>= Parse.liftMaybe + (const "invalid hour") + ) + ) + <*> + ( Parse.string ":" *> + ( Parse.intDecimal <#> toEnum >>= Parse.liftMaybe + (const "invalid minutes") + ) + ) + <*> + ( Parse.string ":" *> + ( Parse.intDecimal <#> toEnum >>= Parse.liftMaybe + (const "invalid seconds") + ) + ) <*> (toEnum 0 # Parse.liftMaybe (const "invalid milliseconds")) ) in pure DateTime <*> (date <* Parse.whiteSpace) <*> time - printDateTime :: DateTime -> String printDateTime dt = let @@ -179,32 +223,42 @@ printDateTime dt = December -> "Dec" time = - [ dt # DateTime.time # DateTime.hour # fromEnum # Int.toStringAs Int.decimal - , dt # DateTime.time # DateTime.minute # fromEnum # Int.toStringAs Int.decimal - , dt # DateTime.time # DateTime.second # fromEnum # Int.toStringAs Int.decimal - ] + [ dt # DateTime.time # DateTime.hour # fromEnum # Int.toStringAs + Int.decimal + , dt # DateTime.time # DateTime.minute # fromEnum # Int.toStringAs + Int.decimal + , dt # DateTime.time # DateTime.second # fromEnum # Int.toStringAs + Int.decimal + ] # Array.intercalate ":" - in - [ weekday (DateTime.weekday $ DateTime.date dt) <> "," - , dt # DateTime.date # DateTime.day # fromEnum # Int.toStringAs Int.decimal - , dt # DateTime.date # DateTime.month # month - , dt # DateTime.date # DateTime.year # fromEnum # Int.toStringAs Int.decimal - , time - ] - # Array.intercalate " " + in + [ weekday (DateTime.weekday $ DateTime.date dt) <> "," + , dt # DateTime.date # DateTime.day # fromEnum # Int.toStringAs Int.decimal + , dt # DateTime.date # DateTime.month # month + , dt # DateTime.date # DateTime.year # fromEnum # Int.toStringAs Int.decimal + , time + ] + # Array.intercalate " " -list :: forall a sep. Parser String sep -> Parser String a -> Parser String (Array a) +list :: + forall a sep. Parser String sep -> Parser String a -> Parser String (Array a) list sep p = do head <- Parse.optionMaybe p - tail <- Array.many (Parse.whiteSpace *> sep *> Parse.whiteSpace *> Parse.optionMaybe p) - pure $ Array.catMaybes $ [head] <> tail + tail <- Array.many + (Parse.whiteSpace *> sep *> Parse.whiteSpace *> Parse.optionMaybe p) + pure $ Array.catMaybes $ [ head ] <> tail -list1 :: forall a sep. Parser String sep -> Parser String a -> Parser String (NonEmptyArray a) +list1 :: + forall a sep. + Parser String sep -> + Parser String a -> + Parser String (NonEmptyArray a) list1 sep p = do head <- p tail <- - Array.many (Parse.whiteSpace *> sep *> Parse.whiteSpace *> Parse.optionMaybe p) - <#> Array.catMaybes + Array.many + (Parse.whiteSpace *> sep *> Parse.whiteSpace *> Parse.optionMaybe p) + <#> Array.catMaybes pure $ Array.NonEmpty.cons' head tail commas :: forall a. Parser String a -> Parser String (Array a) @@ -220,35 +274,44 @@ semis1 :: forall a. Parser String a -> Parser String (NonEmptyArray a) semis1 = list1 $ Parse.string ";" wildcardParser :: Parser String Wildcard -wildcardParser = Parse.whiteSpace *> (Parse.string "*" $> Wildcard) <* Parse.whiteSpace +wildcardParser = Parse.whiteSpace *> (Parse.string "*" $> Wildcard) <* + Parse.whiteSpace mimeParser :: Parser String MIME.MIME -mimeParser = Parse.anyTill (void Parse.space <|> Parse.eof) <#> fst <#> MIME.fromString +mimeParser = Parse.anyTill (void Parse.space <|> Parse.eof) <#> fst <#> + MIME.fromString headerNameRegexParser :: Parser String String -headerNameRegexParser = unsafePartial $ (\(Right a) -> a) $ Parse.regex "[\\w-]+" Regex.Flags.noFlags +headerNameRegexParser = unsafePartial $ (\(Right a) -> a) $ Parse.regex + "[\\w-]+" + Regex.Flags.noFlags closeRegexParser :: Parser String String -closeRegexParser = unsafePartial $ (\(Right a) -> a) $ Parse.regex "\\s*close\\s*" Regex.Flags.ignoreCase +closeRegexParser = unsafePartial $ (\(Right a) -> a) $ Parse.regex + "\\s*close\\s*" + Regex.Flags.ignoreCase headerNameParser :: Parser String StringLower -headerNameParser = Parse.between Parse.whiteSpace Parse.whiteSpace (headerNameRegexParser <#> String.Lower.fromString) +headerNameParser = Parse.between Parse.whiteSpace Parse.whiteSpace + (headerNameRegexParser <#> String.Lower.fromString) methodParser :: Parser String Method methodParser = Parse.try (Parse.string "GET" $> Method.GET) - <|> Parse.try (Parse.string "HEAD" $> Method.HEAD) - <|> Parse.try (Parse.string "POST" $> Method.POST) - <|> Parse.try (Parse.string "PUT" $> Method.PUT) - <|> Parse.try (Parse.string "PATCH" $> Method.PATCH) - <|> Parse.try (Parse.string "DELETE" $> Method.DELETE) - <|> Parse.try (Parse.string "CONNECT" $> Method.CONNECT) - <|> Parse.try (Parse.string "OPTIONS" $> Method.OPTIONS) - <|> Parse.string "TRACE" $> Method.TRACE + <|> Parse.try (Parse.string "HEAD" $> Method.HEAD) + <|> Parse.try (Parse.string "POST" $> Method.POST) + <|> Parse.try (Parse.string "PUT" $> Method.PUT) + <|> Parse.try (Parse.string "PATCH" $> Method.PATCH) + <|> Parse.try (Parse.string "DELETE" $> Method.DELETE) + <|> Parse.try (Parse.string "CONNECT" $> Method.CONNECT) + <|> Parse.try (Parse.string "OPTIONS" $> Method.OPTIONS) + <|> Parse.string "TRACE" + $> Method.TRACE directiveParser :: Parser String (String /\ Maybe String) directiveParser = - pure (/\) <*> rules.token <*> Parse.optionMaybe (Parse.string "=" *> (rules.quoted <|> rules.token)) + pure (/\) <*> rules.token <*> Parse.optionMaybe + (Parse.string "=" *> (rules.quoted <|> rules.token)) class TypedHeader a where headerName :: String @@ -256,110 +319,150 @@ class TypedHeader a where headerValueEncode :: a -> String newtype Accept a = Accept a + derive instance Generic (Accept a) _ derive instance Newtype (Accept a) _ derive instance Eq a => Eq (Accept a) -instance Show a => Show (Accept a) where show = genericShow +instance Show a => Show (Accept a) where + show = genericShow data AccessControlAllowCredentials = AccessControlAllowCredentials + derive instance Generic AccessControlAllowCredentials _ derive instance Eq AccessControlAllowCredentials -instance Show AccessControlAllowCredentials where show = genericShow +instance Show AccessControlAllowCredentials where + show = genericShow + +newtype AccessControlAllowHeaders = AccessControlAllowHeaders + (Wildcard \/ NonEmptyArray StringLower) -newtype AccessControlAllowHeaders = AccessControlAllowHeaders (Wildcard \/ NonEmptyArray StringLower) derive instance Generic (AccessControlAllowHeaders) _ derive instance Newtype (AccessControlAllowHeaders) _ derive instance Eq (AccessControlAllowHeaders) -instance Show AccessControlAllowHeaders where show = genericShow +instance Show AccessControlAllowHeaders where + show = genericShow + +newtype AccessControlAllowMethods = AccessControlAllowMethods + (Wildcard \/ NonEmptyArray Method) -newtype AccessControlAllowMethods = AccessControlAllowMethods (Wildcard \/ NonEmptyArray Method) derive instance Newtype (AccessControlAllowMethods) _ derive instance Eq (AccessControlAllowMethods) derive instance Generic (AccessControlAllowMethods) _ -instance Show (AccessControlAllowMethods) where show = genericShow +instance Show (AccessControlAllowMethods) where + show = genericShow newtype AccessControlAllowOrigin = AccessControlAllowOrigin (Wildcard \/ String) + derive instance Newtype (AccessControlAllowOrigin) _ derive instance Eq (AccessControlAllowOrigin) derive instance Generic (AccessControlAllowOrigin) _ -instance Show (AccessControlAllowOrigin) where show = genericShow +instance Show (AccessControlAllowOrigin) where + show = genericShow + +newtype AccessControlExposeHeaders = AccessControlExposeHeaders + (Wildcard \/ Array StringLower) -newtype AccessControlExposeHeaders = AccessControlExposeHeaders (Wildcard \/ Array StringLower) derive instance Newtype (AccessControlExposeHeaders) _ derive instance Eq (AccessControlExposeHeaders) derive instance Generic (AccessControlExposeHeaders) _ -instance Show (AccessControlExposeHeaders) where show = genericShow +instance Show (AccessControlExposeHeaders) where + show = genericShow newtype AccessControlMaxAge = AccessControlMaxAge Int + derive instance Newtype (AccessControlMaxAge) _ derive instance Eq (AccessControlMaxAge) derive instance Generic (AccessControlMaxAge) _ -instance Show (AccessControlMaxAge) where show = genericShow +instance Show (AccessControlMaxAge) where + show = genericShow + +newtype AccessControlRequestHeaders = AccessControlRequestHeaders + (NonEmptyArray StringLower) -newtype AccessControlRequestHeaders = AccessControlRequestHeaders (NonEmptyArray StringLower) derive instance Newtype (AccessControlRequestHeaders) _ derive instance Eq (AccessControlRequestHeaders) derive instance Generic (AccessControlRequestHeaders) _ -instance Show (AccessControlRequestHeaders) where show = genericShow +instance Show (AccessControlRequestHeaders) where + show = genericShow newtype AccessControlRequestMethod = AccessControlRequestMethod Method + derive instance Newtype (AccessControlRequestMethod) _ derive instance Eq (AccessControlRequestMethod) derive instance Generic (AccessControlRequestMethod) _ -instance Show (AccessControlRequestMethod) where show = genericShow +instance Show (AccessControlRequestMethod) where + show = genericShow newtype Age = Age Int + derive instance Newtype (Age) _ derive instance Generic (Age) _ derive instance Eq (Age) -instance Show (Age) where show = genericShow +instance Show (Age) where + show = genericShow newtype Allow = Allow (NonEmptyArray Method) + derive instance Newtype (Allow) _ derive instance Generic (Allow) _ derive instance Eq (Allow) -instance Show (Allow) where show = genericShow +instance Show (Allow) where + show = genericShow newtype AuthScheme = AuthScheme String + derive instance Newtype (AuthScheme) _ derive instance Generic (AuthScheme) _ derive instance Eq (AuthScheme) -instance Show (AuthScheme) where show = genericShow +instance Show (AuthScheme) where + show = genericShow data Authorization = Authorization AuthScheme String + derive instance Generic (Authorization) _ derive instance Eq (Authorization) -instance Show (Authorization) where show = genericShow +instance Show (Authorization) where + show = genericShow newtype BearerAuth = BearerAuth String + derive instance Newtype (BearerAuth) _ derive instance Generic (BearerAuth) _ derive instance Eq (BearerAuth) -instance Show (BearerAuth) where show = genericShow +instance Show (BearerAuth) where + show = genericShow + +newtype BasicAuth = BasicAuth { username :: String, password :: String } -newtype BasicAuth = BasicAuth {username :: String, password :: String} derive instance Newtype (BasicAuth) _ derive instance Generic (BasicAuth) _ derive instance Eq (BasicAuth) -instance Show (BasicAuth) where show = genericShow +instance Show (BasicAuth) where + show = genericShow newtype ByteRangeStart = ByteRangeStart Int + derive instance Newtype (ByteRangeStart) _ derive instance Generic (ByteRangeStart) _ derive instance Eq (ByteRangeStart) -instance Show (ByteRangeStart) where show = genericShow +instance Show (ByteRangeStart) where + show = genericShow newtype ByteRangeEnd = ByteRangeEnd Int + derive instance Newtype (ByteRangeEnd) _ derive instance Generic (ByteRangeEnd) _ derive instance Eq (ByteRangeEnd) -instance Show (ByteRangeEnd) where show = genericShow +instance Show (ByteRangeEnd) where + show = genericShow newtype ByteRangeLength = ByteRangeLength Int + derive instance Newtype (ByteRangeLength) _ derive instance Generic (ByteRangeLength) _ derive instance Eq (ByteRangeLength) -instance Show (ByteRangeLength) where show = genericShow +instance Show (ByteRangeLength) where + show = genericShow type CacheControl' = ( maxAge :: Maybe Int @@ -381,171 +484,256 @@ type CacheControl' = ) newtype CacheControl = CacheControl (Record CacheControl') + derive instance Newtype (CacheControl) _ derive instance Generic (CacheControl) _ derive instance Eq (CacheControl) -instance Show (CacheControl) where show = genericShow +instance Show (CacheControl) where + show = genericShow data ConnectionClose = ConnectionClose + derive instance Eq (ConnectionClose) -instance Show (ConnectionClose) where show = genericShow +instance Show (ConnectionClose) where + show = genericShow + derive instance Generic (ConnectionClose) _ newtype Connection = Connection (ConnectionClose \/ NonEmptyArray StringLower) + derive instance Newtype (Connection) _ derive instance Generic (Connection) _ derive instance Eq (Connection) -instance Show (Connection) where show = genericShow +instance Show (Connection) where + show = genericShow + +newtype ContentDisposition = ContentDisposition + ( ContentDispositionInline \/ ContentDispositionAttachment + \/ ContentDispositionFormData + \/ Void + ) -newtype ContentDisposition = ContentDisposition (ContentDispositionInline \/ ContentDispositionAttachment \/ ContentDispositionFormData \/ Void) derive instance Newtype (ContentDisposition) _ derive instance Generic (ContentDisposition) _ derive instance Eq (ContentDisposition) -instance Show (ContentDisposition) where show = genericShow +instance Show (ContentDisposition) where + show = genericShow data ContentDispositionInline = ContentDispositionInline + derive instance Generic (ContentDispositionInline) _ derive instance Eq (ContentDispositionInline) -instance Show (ContentDispositionInline) where show = genericShow +instance Show (ContentDispositionInline) where + show = genericShow + +newtype ContentDispositionAttachment = ContentDispositionAttachment + { filename :: Maybe String } -newtype ContentDispositionAttachment = ContentDispositionAttachment {filename :: Maybe String} derive instance Newtype (ContentDispositionAttachment) _ derive instance Generic (ContentDispositionAttachment) _ derive instance Eq (ContentDispositionAttachment) -instance Show (ContentDispositionAttachment) where show = genericShow +instance Show (ContentDispositionAttachment) where + show = genericShow + +newtype ContentDispositionFormData = ContentDispositionFormData + { filename :: Maybe String, name :: Maybe String } -newtype ContentDispositionFormData = ContentDispositionFormData {filename :: Maybe String, name :: Maybe String} derive instance Newtype (ContentDispositionFormData) _ derive instance Generic (ContentDispositionFormData) _ derive instance Eq (ContentDispositionFormData) -instance Show (ContentDispositionFormData) where show = genericShow +instance Show (ContentDispositionFormData) where + show = genericShow newtype ContentEncoding = ContentEncoding (NonEmptyArray String) + derive instance Newtype (ContentEncoding) _ derive instance Generic (ContentEncoding) _ derive instance Eq (ContentEncoding) -instance Show (ContentEncoding) where show = genericShow +instance Show (ContentEncoding) where + show = genericShow newtype ContentLength = ContentLength Int + derive instance Newtype (ContentLength) _ derive instance Generic (ContentLength) _ derive instance Eq (ContentLength) -instance Show (ContentLength) where show = genericShow +instance Show (ContentLength) where + show = genericShow newtype ContentLocation = ContentLocation String + derive instance Newtype (ContentLocation) _ derive instance Generic (ContentLocation) _ derive instance Eq (ContentLocation) -instance Show (ContentLocation) where show = genericShow +instance Show (ContentLocation) where + show = genericShow + +newtype ContentRange = ContentRange + ( (ByteRangeStart /\ ByteRangeEnd /\ ByteRangeLength) + \/ (ByteRangeStart /\ ByteRangeEnd) + \/ ByteRangeLength + \/ Void + ) -newtype ContentRange = ContentRange ((ByteRangeStart /\ ByteRangeEnd /\ ByteRangeLength) \/ (ByteRangeStart /\ ByteRangeEnd) \/ ByteRangeLength \/ Void) derive instance Newtype (ContentRange) _ derive instance Generic (ContentRange) _ derive instance Eq (ContentRange) -instance Show (ContentRange) where show = genericShow +instance Show (ContentRange) where + show = genericShow newtype ContentType a = ContentType a + derive instance Generic (ContentType a) _ derive instance Newtype (ContentType a) _ derive instance Eq a => Eq (ContentType a) -instance Show a => Show (ContentType a) where show = genericShow +instance Show a => Show (ContentType a) where + show = genericShow newtype Cookie = Cookie (NonEmptyArray (String /\ String)) + derive instance Newtype (Cookie) _ derive instance Generic (Cookie) _ -instance Show (Cookie) where show = genericShow +instance Show (Cookie) where + show = genericShow + derive instance Eq (Cookie) newtype Date = Date DateTime + derive instance Newtype (Date) _ derive instance Generic (Date) _ -instance Show (Date) where show = genericShow +instance Show (Date) where + show = genericShow + derive instance Eq (Date) newtype ETag = ETag String + derive instance Newtype (ETag) _ derive instance Generic (ETag) _ -instance Show (ETag) where show = genericShow +instance Show (ETag) where + show = genericShow + derive instance Eq (ETag) data ExpectContinue = ExpectContinue newtype Expires = Expires DateTime + derive instance Newtype (Expires) _ derive instance Generic (Expires) _ -instance Show (Expires) where show = genericShow +instance Show (Expires) where + show = genericShow + derive instance Eq (Expires) newtype Host = Host String + derive instance Newtype (Host) _ derive instance Generic (Host) _ -instance Show (Host) where show = genericShow +instance Show (Host) where + show = genericShow + derive instance Eq (Host) newtype IfMatch = IfMatch (Wildcard \/ NonEmptyArray String) + derive instance Newtype (IfMatch) _ derive instance Generic (IfMatch) _ -instance Show (IfMatch) where show = genericShow +instance Show (IfMatch) where + show = genericShow + derive instance Eq (IfMatch) newtype IfNoneMatch = IfNoneMatch (Wildcard \/ NonEmptyArray MatchETag) + derive instance Newtype (IfNoneMatch) _ derive instance Generic (IfNoneMatch) _ -instance Show (IfNoneMatch) where show = genericShow +instance Show (IfNoneMatch) where + show = genericShow + derive instance Eq (IfNoneMatch) newtype IfModifiedSince = IfModifiedSince DateTime + derive instance Newtype (IfModifiedSince) _ derive instance Generic (IfModifiedSince) _ -instance Show (IfModifiedSince) where show = genericShow +instance Show (IfModifiedSince) where + show = genericShow + derive instance Eq (IfModifiedSince) newtype IfRange = IfRange (DateTime \/ String) + derive instance Newtype (IfRange) _ derive instance Generic (IfRange) _ -instance Show (IfRange) where show = genericShow +instance Show (IfRange) where + show = genericShow + derive instance Eq (IfRange) newtype IfUnmodifiedSince = IfUnmodifiedSince DateTime + derive instance Newtype (IfUnmodifiedSince) _ derive instance Generic (IfUnmodifiedSince) _ -instance Show (IfUnmodifiedSince) where show = genericShow +instance Show (IfUnmodifiedSince) where + show = genericShow + derive instance Eq (IfUnmodifiedSince) newtype LastModified = LastModified DateTime + derive instance Newtype (LastModified) _ derive instance Generic (LastModified) _ -instance Show (LastModified) where show = genericShow +instance Show (LastModified) where + show = genericShow + derive instance Eq (LastModified) data MatchETag = MatchETag String | MatchETagWeak String -derive instance Eq MatchETag -instance Show MatchETag where show = genericShow + +derive instance Eq MatchETag +instance Show MatchETag where + show = genericShow + derive instance Generic MatchETag _ newtype Origin = Origin String + derive instance Newtype (Origin) _ derive instance Generic (Origin) _ -instance Show (Origin) where show = genericShow +instance Show (Origin) where + show = genericShow + derive instance Eq (Origin) data ProxyAuthorization = ProxyAuthorization AuthScheme String + derive instance Generic (ProxyAuthorization) _ derive instance Eq (ProxyAuthorization) -instance Show (ProxyAuthorization) where show = genericShow +instance Show (ProxyAuthorization) where + show = genericShow -type RangeSpecifier = ByteRangeStart \/ (ByteRangeStart /\ ByteRangeEnd) \/ ByteRangeLength \/ Void +type RangeSpecifier = ByteRangeStart \/ (ByteRangeStart /\ ByteRangeEnd) + \/ ByteRangeLength + \/ Void newtype Range = Range (NonEmptyArray RangeSpecifier) + derive instance Newtype (Range) _ derive instance Generic (Range) _ -instance Show (Range) where show = genericShow +instance Show (Range) where + show = genericShow + derive instance Eq (Range) newtype Referer = Referer String + derive instance Newtype (Referer) _ derive instance Generic (Referer) _ -instance Show (Referer) where show = genericShow +instance Show (Referer) where + show = genericShow + derive instance Eq (Referer) data ReferrerPolicy @@ -560,78 +748,116 @@ data ReferrerPolicy derive instance Generic (ReferrerPolicy) _ derive instance Eq (ReferrerPolicy) -instance Show (ReferrerPolicy) where show = genericShow +instance Show (ReferrerPolicy) where + show = genericShow newtype RetryAfter = RetryAfter (DateTime \/ Int) + derive instance Newtype (RetryAfter) _ derive instance Generic (RetryAfter) _ -instance Show (RetryAfter) where show = genericShow +instance Show (RetryAfter) where + show = genericShow + derive instance Eq (RetryAfter) newtype SecWebsocketKey = SecWebsocketKey String + derive instance Newtype (SecWebsocketKey) _ derive instance Generic (SecWebsocketKey) _ -instance Show (SecWebsocketKey) where show = genericShow +instance Show (SecWebsocketKey) where + show = genericShow + derive instance Eq (SecWebsocketKey) newtype SecWebsocketAccept = SecWebsocketAccept SecWebsocketKey + derive instance Newtype (SecWebsocketAccept) _ derive instance Generic (SecWebsocketAccept) _ -instance Show (SecWebsocketAccept) where show = genericShow +instance Show (SecWebsocketAccept) where + show = genericShow + derive instance Eq (SecWebsocketAccept) newtype SecWebsocketVersion = SecWebsocketVersion (NonEmptyArray Int) + derive instance Newtype (SecWebsocketVersion) _ derive instance Generic (SecWebsocketVersion) _ -instance Show (SecWebsocketVersion) where show = genericShow +instance Show (SecWebsocketVersion) where + show = genericShow + derive instance Eq (SecWebsocketVersion) newtype Server = Server String + derive instance Newtype (Server) _ derive instance Generic (Server) _ -instance Show (Server) where show = genericShow +instance Show (Server) where + show = genericShow + derive instance Eq (Server) newtype SetCookie = SetCookie String + derive instance Newtype (SetCookie) _ derive instance Generic (SetCookie) _ -instance Show (SetCookie) where show = genericShow +instance Show (SetCookie) where + show = genericShow + derive instance Eq (SetCookie) -newtype StrictTransportSecurity = StrictTransportSecurity {maxAge :: Maybe Int, includeSubdomains :: Boolean} +newtype StrictTransportSecurity = StrictTransportSecurity + { maxAge :: Maybe Int, includeSubdomains :: Boolean } + derive instance Newtype (StrictTransportSecurity) _ derive instance Generic (StrictTransportSecurity) _ -instance Show (StrictTransportSecurity) where show = genericShow +instance Show (StrictTransportSecurity) where + show = genericShow + derive instance Eq (StrictTransportSecurity) newtype TE = TE String + derive instance Newtype (TE) _ derive instance Generic (TE) _ -instance Show (TE) where show = genericShow +instance Show (TE) where + show = genericShow + derive instance Eq (TE) newtype TransferEncoding = TransferEncoding String + derive instance Newtype (TransferEncoding) _ derive instance Generic (TransferEncoding) _ -instance Show (TransferEncoding) where show = genericShow +instance Show (TransferEncoding) where + show = genericShow + derive instance Eq (TransferEncoding) newtype Upgrade = Upgrade (NonEmptyArray String) + derive instance Newtype (Upgrade) _ derive instance Generic (Upgrade) _ -instance Show (Upgrade) where show = genericShow +instance Show (Upgrade) where + show = genericShow + derive instance Eq (Upgrade) newtype UserAgent = UserAgent String + derive instance Newtype (UserAgent) _ derive instance Generic (UserAgent) _ -instance Show (UserAgent) where show = genericShow +instance Show (UserAgent) where + show = genericShow + derive instance Eq (UserAgent) newtype Vary = Vary (Wildcard \/ NonEmptyArray StringLower) + derive instance Newtype (Vary) _ derive instance Generic (Vary) _ -instance Show (Vary) where show = genericShow +instance Show (Vary) where + show = genericShow + derive instance Eq (Vary) cacheControlDefaults :: Record CacheControl' @@ -654,593 +880,1727 @@ cacheControlDefaults = , staleIfError: false } -cacheControl :: forall missing r withDefaults. Nub withDefaults CacheControl' => Union r CacheControl' withDefaults => Union missing r CacheControl' => Record r -> CacheControl +cacheControl :: + forall missing r withDefaults. + Nub withDefaults CacheControl' => + Union r CacheControl' withDefaults => + Union missing r CacheControl' => + Record r -> + CacheControl cacheControl a = CacheControl $ Record.merge a cacheControlDefaults instance TypedHeader (Accept String) where headerName = "Accept" headerValueParser = Parse.rest <#> Accept headerValueEncode = unwrap + instance TypedHeader (Accept MIME.MIME) where headerName = "Accept" headerValueParser = mimeParser <#> Accept headerValueEncode = MIME.toString <<< unwrap + instance TypedHeader (Accept Type.MIME.Aac) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Aac)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Aac) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Aac) + instance TypedHeader (Accept Type.MIME.Abw) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Abw)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Abw) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Abw) + instance TypedHeader (Accept Type.MIME.Arc) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Arc)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Arc) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Arc) + instance TypedHeader (Accept Type.MIME.Avif) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Avif)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Avif) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Avif) + instance TypedHeader (Accept Type.MIME.Avi) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Avi)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Avi) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Avi) + instance TypedHeader (Accept Type.MIME.Azw) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Azw)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Azw) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Azw) + instance TypedHeader (Accept Type.MIME.Bin) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Bin)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Bin) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Bin) + instance TypedHeader (Accept Type.MIME.Bmp) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Bmp)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Bmp) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Bmp) + instance TypedHeader (Accept Type.MIME.Bz) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Bz)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Bz)) + <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Bz) + instance TypedHeader (Accept Type.MIME.Bz2) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Bz2)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Bz2) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Bz2) + instance TypedHeader (Accept Type.MIME.Cda) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Cda)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Cda) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Cda) + instance TypedHeader (Accept Type.MIME.Csh) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Csh)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Csh) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Csh) + instance TypedHeader (Accept Type.MIME.Css) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Css)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Css) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Css) + instance TypedHeader (Accept Type.MIME.Csv) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Csv)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Csv) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Csv) + instance TypedHeader (Accept Type.MIME.Doc) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Doc)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Doc) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Doc) + instance TypedHeader (Accept Type.MIME.Docx) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Docx)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Docx) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Docx) + instance TypedHeader (Accept Type.MIME.Eot) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Eot)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Eot) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Eot) + instance TypedHeader (Accept Type.MIME.Epub) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Epub)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Epub) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Epub) + instance TypedHeader (Accept Type.MIME.Gz) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Gz)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Gz)) + <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Gz) + instance TypedHeader (Accept Type.MIME.Gif) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Gif)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Gif) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Gif) + instance TypedHeader (Accept Type.MIME.Html) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Html)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Html) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Html) + instance TypedHeader (Accept Type.MIME.Ico) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ico)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ico) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ico) + instance TypedHeader (Accept Type.MIME.Ics) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ics)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ics) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ics) + instance TypedHeader (Accept Type.MIME.Jar) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Jar)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Jar) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Jar) + instance TypedHeader (Accept Type.MIME.Jpeg) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Jpeg)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Jpeg) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Jpeg) + instance TypedHeader (Accept Type.MIME.Js) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Js)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Js)) + <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Js) + instance TypedHeader (Accept Type.MIME.Json) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Json)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Json) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Json) + instance TypedHeader (Accept Type.MIME.Jsonld) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Jsonld)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Jsonld) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Jsonld) + instance TypedHeader (Accept Type.MIME.Midi) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Midi)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Midi) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Midi) + instance TypedHeader (Accept Type.MIME.Mp3) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Mp3)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Mp3) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Mp3) + instance TypedHeader (Accept Type.MIME.Mp4) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Mp4)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Mp4) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Mp4) + instance TypedHeader (Accept Type.MIME.Mpeg) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Mpeg)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Mpeg) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Mpeg) + instance TypedHeader (Accept Type.MIME.Mpkg) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Mpkg)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Mpkg) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Mpkg) + instance TypedHeader (Accept Type.MIME.Odp) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Odp)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Odp) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Odp) + instance TypedHeader (Accept Type.MIME.Ods) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ods)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ods) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ods) + instance TypedHeader (Accept Type.MIME.Odt) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Odt)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Odt) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Odt) + instance TypedHeader (Accept Type.MIME.Oga) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Oga)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Oga) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Oga) + instance TypedHeader (Accept Type.MIME.Ogv) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ogv)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ogv) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ogv) + instance TypedHeader (Accept Type.MIME.Ogx) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ogx)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ogx) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ogx) + instance TypedHeader (Accept Type.MIME.Opus) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Opus)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Opus) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Opus) + instance TypedHeader (Accept Type.MIME.Otf) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Otf)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Otf) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Otf) + instance TypedHeader (Accept Type.MIME.Png) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Png)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Png) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Png) + instance TypedHeader (Accept Type.MIME.Pdf) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Pdf)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Pdf) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Pdf) + instance TypedHeader (Accept Type.MIME.Php) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Php)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Php) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Php) + instance TypedHeader (Accept Type.MIME.Ppt) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ppt)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ppt) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ppt) + instance TypedHeader (Accept Type.MIME.Pptx) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Pptx)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Pptx) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Pptx) + instance TypedHeader (Accept Type.MIME.Rar) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Rar)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Rar) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Rar) + instance TypedHeader (Accept Type.MIME.Rtf) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Rtf)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Rtf) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Rtf) + instance TypedHeader (Accept Type.MIME.Sh) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Sh)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Sh)) + <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Sh) + instance TypedHeader (Accept Type.MIME.Svg) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Svg)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Svg) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Svg) + instance TypedHeader (Accept Type.MIME.Tar) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Tar)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Tar) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Tar) + instance TypedHeader (Accept Type.MIME.Tif) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Tif)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Tif) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Tif) + instance TypedHeader (Accept Type.MIME.Ts) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ts)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ts)) + <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ts) + instance TypedHeader (Accept Type.MIME.Ttf) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ttf)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ttf) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ttf) + instance TypedHeader (Accept Type.MIME.Txt) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Txt)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Txt) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Txt) + instance TypedHeader (Accept Type.MIME.Vsd) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Vsd)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Vsd) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Vsd) + instance TypedHeader (Accept Type.MIME.Wav) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Wav)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Wav) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Wav) + instance TypedHeader (Accept Type.MIME.Weba) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Weba)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Weba) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Weba) + instance TypedHeader (Accept Type.MIME.Webm) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Webm)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Webm) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Webm) + instance TypedHeader (Accept Type.MIME.Webp) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Webp)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Webp) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Webp) + instance TypedHeader (Accept Type.MIME.Woff) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Woff)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Woff) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Woff) + instance TypedHeader (Accept Type.MIME.Woff2) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Woff2)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Woff2) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Woff2) + instance TypedHeader (Accept Type.MIME.Xhtml) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Xhtml)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Xhtml) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Xhtml) + instance TypedHeader (Accept Type.MIME.Xls) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Xls)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Xls) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Xls) + instance TypedHeader (Accept Type.MIME.Xlsx) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Xlsx)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Xlsx) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Xlsx) + instance TypedHeader (Accept Type.MIME.Xml) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Xml)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Xml) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Xml) + instance TypedHeader (Accept Type.MIME.Xul) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Xul)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Xul) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Xul) + instance TypedHeader (Accept Type.MIME.Zip) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Zip)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Zip) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Zip) + instance TypedHeader (Accept Type.MIME.Video3gp) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Video3gp)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Video3gp) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Video3gp) + instance TypedHeader (Accept Type.MIME.Video3g2) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Video3g2)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Video3g2) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Video3g2) + instance TypedHeader (Accept Type.MIME.Archive7z) where headerName = "Accept" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Archive7z)) <<< Type.MIME.fromValue) <#> Accept + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Archive7z) + ) <<< Type.MIME.fromValue + ) + <#> Accept headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Archive7z) instance TypedHeader (ContentType String) where headerName = "Content-Type" headerValueParser = Parse.rest <#> ContentType headerValueEncode = unwrap + instance TypedHeader (ContentType MIME.MIME) where headerName = "Content-Type" headerValueParser = mimeParser <#> ContentType headerValueEncode = MIME.toString <<< unwrap + instance TypedHeader (ContentType Type.MIME.Aac) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Aac)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Aac) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Aac) + instance TypedHeader (ContentType Type.MIME.Abw) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Abw)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Abw) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Abw) + instance TypedHeader (ContentType Type.MIME.Arc) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Arc)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Arc) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Arc) + instance TypedHeader (ContentType Type.MIME.Avif) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Avif)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Avif) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Avif) + instance TypedHeader (ContentType Type.MIME.Avi) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Avi)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Avi) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Avi) + instance TypedHeader (ContentType Type.MIME.Azw) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Azw)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Azw) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Azw) + instance TypedHeader (ContentType Type.MIME.Bin) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Bin)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Bin) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Bin) + instance TypedHeader (ContentType Type.MIME.Bmp) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Bmp)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Bmp) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Bmp) + instance TypedHeader (ContentType Type.MIME.Bz) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Bz)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Bz)) + <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Bz) + instance TypedHeader (ContentType Type.MIME.Bz2) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Bz2)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Bz2) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Bz2) + instance TypedHeader (ContentType Type.MIME.Cda) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Cda)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Cda) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Cda) + instance TypedHeader (ContentType Type.MIME.Csh) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Csh)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Csh) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Csh) + instance TypedHeader (ContentType Type.MIME.Css) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Css)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Css) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Css) + instance TypedHeader (ContentType Type.MIME.Csv) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Csv)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Csv) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Csv) + instance TypedHeader (ContentType Type.MIME.Doc) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Doc)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Doc) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Doc) + instance TypedHeader (ContentType Type.MIME.Docx) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Docx)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Docx) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Docx) + instance TypedHeader (ContentType Type.MIME.Eot) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Eot)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Eot) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Eot) + instance TypedHeader (ContentType Type.MIME.Epub) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Epub)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Epub) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Epub) + instance TypedHeader (ContentType Type.MIME.Gz) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Gz)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Gz)) + <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Gz) + instance TypedHeader (ContentType Type.MIME.Gif) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Gif)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Gif) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Gif) + instance TypedHeader (ContentType Type.MIME.Html) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Html)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Html) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Html) + instance TypedHeader (ContentType Type.MIME.Ico) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ico)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ico) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ico) + instance TypedHeader (ContentType Type.MIME.Ics) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ics)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ics) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ics) + instance TypedHeader (ContentType Type.MIME.Jar) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Jar)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Jar) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Jar) + instance TypedHeader (ContentType Type.MIME.Jpeg) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Jpeg)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Jpeg) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Jpeg) + instance TypedHeader (ContentType Type.MIME.Js) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Js)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Js)) + <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Js) + instance TypedHeader (ContentType Type.MIME.Json) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Json)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Json) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Json) + instance TypedHeader (ContentType Type.MIME.Jsonld) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Jsonld)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Jsonld) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Jsonld) + instance TypedHeader (ContentType Type.MIME.Midi) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Midi)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Midi) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Midi) + instance TypedHeader (ContentType Type.MIME.Mp3) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Mp3)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Mp3) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Mp3) + instance TypedHeader (ContentType Type.MIME.Mp4) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Mp4)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Mp4) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Mp4) + instance TypedHeader (ContentType Type.MIME.Mpeg) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Mpeg)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Mpeg) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Mpeg) + instance TypedHeader (ContentType Type.MIME.Mpkg) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Mpkg)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Mpkg) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Mpkg) + instance TypedHeader (ContentType Type.MIME.Odp) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Odp)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Odp) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Odp) + instance TypedHeader (ContentType Type.MIME.Ods) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ods)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ods) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ods) + instance TypedHeader (ContentType Type.MIME.Odt) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Odt)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Odt) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Odt) + instance TypedHeader (ContentType Type.MIME.Oga) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Oga)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Oga) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Oga) + instance TypedHeader (ContentType Type.MIME.Ogv) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ogv)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ogv) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ogv) + instance TypedHeader (ContentType Type.MIME.Ogx) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ogx)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ogx) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ogx) + instance TypedHeader (ContentType Type.MIME.Opus) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Opus)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Opus) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Opus) + instance TypedHeader (ContentType Type.MIME.Otf) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Otf)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Otf) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Otf) + instance TypedHeader (ContentType Type.MIME.Png) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Png)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Png) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Png) + instance TypedHeader (ContentType Type.MIME.Pdf) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Pdf)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Pdf) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Pdf) + instance TypedHeader (ContentType Type.MIME.Php) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Php)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Php) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Php) + instance TypedHeader (ContentType Type.MIME.Ppt) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ppt)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ppt) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ppt) + instance TypedHeader (ContentType Type.MIME.Pptx) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Pptx)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Pptx) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Pptx) + instance TypedHeader (ContentType Type.MIME.Rar) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Rar)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Rar) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Rar) + instance TypedHeader (ContentType Type.MIME.Rtf) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Rtf)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Rtf) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Rtf) + instance TypedHeader (ContentType Type.MIME.Sh) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Sh)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Sh)) + <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Sh) + instance TypedHeader (ContentType Type.MIME.Svg) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Svg)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Svg) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Svg) + instance TypedHeader (ContentType Type.MIME.Tar) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Tar)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Tar) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Tar) + instance TypedHeader (ContentType Type.MIME.Tif) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Tif)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Tif) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Tif) + instance TypedHeader (ContentType Type.MIME.Ts) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ts)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ts)) + <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ts) + instance TypedHeader (ContentType Type.MIME.Ttf) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Ttf)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Ttf) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Ttf) + instance TypedHeader (ContentType Type.MIME.Txt) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Txt)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Txt) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Txt) + instance TypedHeader (ContentType Type.MIME.Vsd) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Vsd)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Vsd) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Vsd) + instance TypedHeader (ContentType Type.MIME.Wav) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Wav)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Wav) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Wav) + instance TypedHeader (ContentType Type.MIME.Weba) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Weba)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Weba) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Weba) + instance TypedHeader (ContentType Type.MIME.Webm) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Webm)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Webm) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Webm) + instance TypedHeader (ContentType Type.MIME.Webp) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Webp)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Webp) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Webp) + instance TypedHeader (ContentType Type.MIME.Woff) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Woff)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Woff) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Woff) + instance TypedHeader (ContentType Type.MIME.Woff2) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Woff2)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Woff2) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Woff2) + instance TypedHeader (ContentType Type.MIME.Xhtml) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Xhtml)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Xhtml) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Xhtml) + instance TypedHeader (ContentType Type.MIME.Xls) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Xls)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Xls) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Xls) + instance TypedHeader (ContentType Type.MIME.Xlsx) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Xlsx)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Xlsx) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Xlsx) + instance TypedHeader (ContentType Type.MIME.Xml) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Xml)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Xml) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Xml) + instance TypedHeader (ContentType Type.MIME.Xul) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Xul)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Xul) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Xul) + instance TypedHeader (ContentType Type.MIME.Zip) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Zip)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Zip) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Zip) + instance TypedHeader (ContentType Type.MIME.Video3gp) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Video3gp)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Video3gp) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Video3gp) + instance TypedHeader (ContentType Type.MIME.Video3g2) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Video3g2)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Video3g2) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Video3g2) + instance TypedHeader (ContentType Type.MIME.Archive7z) where headerName = "Content-Type" - headerValueParser = mimeParser >>= (Parse.liftMaybe (const $ "expected " <> MIME.toString (Type.MIME.value @Type.MIME.Archive7z)) <<< Type.MIME.fromValue) <#> ContentType + headerValueParser = mimeParser + >>= + ( Parse.liftMaybe + ( const $ "expected " <> MIME.toString + (Type.MIME.value @Type.MIME.Archive7z) + ) <<< Type.MIME.fromValue + ) + <#> ContentType headerValueEncode _ = MIME.toString (Type.MIME.value @Type.MIME.Archive7z) instance TypedHeader AccessControlAllowCredentials where @@ -1252,11 +2612,15 @@ instance TypedHeader AccessControlAllowHeaders where headerName = "Access-Control-Allow-Headers" headerValueParser = let - headers = commas1 rules.token <#> map String.Lower.fromString <#> Right <#> AccessControlAllowHeaders + headers = commas1 rules.token <#> map String.Lower.fromString <#> Right + <#> AccessControlAllowHeaders in - Parse.try (wildcardParser $> AccessControlAllowHeaders (Left Wildcard)) <|> Parse.try headers + Parse.try (wildcardParser $> AccessControlAllowHeaders (Left Wildcard)) + <|> Parse.try headers headerValueEncode (AccessControlAllowHeaders (Left Wildcard)) = "*" - headerValueEncode (AccessControlAllowHeaders (Right hs)) = hs <#> String.Lower.toString # Array.NonEmpty.intercalate ", " + headerValueEncode (AccessControlAllowHeaders (Right hs)) = hs + <#> String.Lower.toString + # Array.NonEmpty.intercalate ", " instance TypedHeader AccessControlAllowMethods where headerName = "Access-Control-Allow-Methods" @@ -1264,9 +2628,12 @@ instance TypedHeader AccessControlAllowMethods where let methods = commas1 methodParser <#> Right <#> AccessControlAllowMethods in - Parse.try (wildcardParser $> AccessControlAllowMethods (Left Wildcard)) <|> Parse.try methods + Parse.try (wildcardParser $> AccessControlAllowMethods (Left Wildcard)) + <|> Parse.try methods headerValueEncode (AccessControlAllowMethods (Left Wildcard)) = "*" - headerValueEncode (AccessControlAllowMethods (Right ms)) = ms <#> Method.toString # Array.NonEmpty.intercalate ", " + headerValueEncode (AccessControlAllowMethods (Right ms)) = ms + <#> Method.toString + # Array.NonEmpty.intercalate ", " instance TypedHeader AccessControlAllowOrigin where headerName = "Access-Control-Allow-Origin" @@ -1274,7 +2641,8 @@ instance TypedHeader AccessControlAllowOrigin where let str = Parse.rest <#> String.trim <#> Right <#> AccessControlAllowOrigin in - Parse.try (wildcardParser $> AccessControlAllowOrigin (Left Wildcard)) <|> Parse.try str + Parse.try (wildcardParser $> AccessControlAllowOrigin (Left Wildcard)) <|> + Parse.try str headerValueEncode (AccessControlAllowOrigin (Left Wildcard)) = "*" headerValueEncode (AccessControlAllowOrigin (Right a)) = a @@ -1284,19 +2652,26 @@ instance TypedHeader AccessControlExposeHeaders where let str = commas headerNameParser <#> Right <#> AccessControlExposeHeaders in - Parse.try (wildcardParser $> AccessControlExposeHeaders (Left Wildcard)) <|> Parse.try str + Parse.try (wildcardParser $> AccessControlExposeHeaders (Left Wildcard)) + <|> Parse.try str headerValueEncode (AccessControlExposeHeaders (Left Wildcard)) = "*" - headerValueEncode (AccessControlExposeHeaders (Right hs)) = hs <#> String.Lower.toString # Array.intercalate ", " + headerValueEncode (AccessControlExposeHeaders (Right hs)) = hs + <#> String.Lower.toString + # Array.intercalate ", " instance TypedHeader AccessControlMaxAge where headerName = "Access-Control-Max-Age" - headerValueParser = Parse.between Parse.whiteSpace Parse.whiteSpace Parse.intDecimal <#> AccessControlMaxAge + headerValueParser = + Parse.between Parse.whiteSpace Parse.whiteSpace Parse.intDecimal <#> + AccessControlMaxAge headerValueEncode (AccessControlMaxAge i) = Int.toStringAs Int.decimal i instance TypedHeader AccessControlRequestHeaders where headerName = "Access-Control-Request-Headers" headerValueParser = commas1 headerNameParser <#> AccessControlRequestHeaders - headerValueEncode (AccessControlRequestHeaders hs) = hs <#> String.Lower.toString # Array.NonEmpty.intercalate ", " + headerValueEncode (AccessControlRequestHeaders hs) = hs + <#> String.Lower.toString + # Array.NonEmpty.intercalate ", " instance TypedHeader AccessControlRequestMethod where headerName = "Access-Control-Request-Method" @@ -1305,39 +2680,46 @@ instance TypedHeader AccessControlRequestMethod where instance TypedHeader Age where headerName = "Age" - headerValueParser = Parse.between Parse.whiteSpace Parse.whiteSpace Parse.intDecimal <#> Age + headerValueParser = + Parse.between Parse.whiteSpace Parse.whiteSpace Parse.intDecimal <#> Age headerValueEncode (Age i) = Int.toStringAs Int.decimal i instance TypedHeader Allow where headerName = "Allow" headerValueParser = commas1 methodParser <#> Allow - headerValueEncode (Allow ms) = ms <#> Method.toString # Array.NonEmpty.intercalate ", " + headerValueEncode (Allow ms) = ms <#> Method.toString # + Array.NonEmpty.intercalate ", " instance TypedHeader Authorization where headerName = "Authorization" headerValueParser = pure (\scheme val -> Authorization scheme val) - <*> ((rules.token <#> AuthScheme) <* Parse.whiteSpace) - <*> (Parse.optionMaybe rules.token68 <#> fromMaybe "") + <*> ((rules.token <#> AuthScheme) <* Parse.whiteSpace) + <*> (Parse.optionMaybe rules.token68 <#> fromMaybe "") headerValueEncode (Authorization (AuthScheme s) v) = s <> " " <> v instance TypedHeader BasicAuth where headerName = "Authorization" headerValueParser = do Authorization (AuthScheme s) v <- headerValueParser @Authorization - when (String.toLower s /= "basic") $ Parse.fail $ "expected Authorization scheme to be Basic, found " <> s + when (String.toLower s /= "basic") $ Parse.fail + $ "expected Authorization scheme to be Basic, found " + <> s decoded <- String.Base64.decode v # lmap Error.message # Parse.liftEither case String.split (wrap ":") decoded of - [username, password] -> pure $ BasicAuth {username, password} + [ username, password ] -> pure $ BasicAuth { username, password } _ -> Parse.fail "malformed Basic Auth" - headerValueEncode (BasicAuth {username, password}) = - headerValueEncode $ Authorization (AuthScheme "Basic") (String.Base64.encode (username <> ":" <> password)) + headerValueEncode (BasicAuth { username, password }) = + headerValueEncode $ Authorization (AuthScheme "Basic") + (String.Base64.encode (username <> ":" <> password)) instance TypedHeader BearerAuth where headerName = "Authorization" headerValueParser = do Authorization (AuthScheme s) v <- headerValueParser @Authorization - when (String.toLower s /= "bearer") $ Parse.fail $ "expected Authorization scheme to be Bearer, found " <> s + when (String.toLower s /= "bearer") $ Parse.fail + $ "expected Authorization scheme to be Bearer, found " + <> s pure $ BearerAuth v headerValueEncode (BearerAuth a) = headerValueEncode $ Authorization (AuthScheme "Bearer") a @@ -1348,22 +2730,23 @@ instance TypedHeader CacheControl where directives <- commas directiveParser <#> Map.fromFoldable pure $ CacheControl { maxAge: Map.lookup "max-age" directives # join >>= Int.fromString - , maxStale: Map.lookup "max-stale" directives # join >>= Int.fromString - , minFresh: Map.lookup "min-fresh" directives # join >>= Int.fromString - , sMaxAge: Map.lookup "s-maxage" directives # join >>= Int.fromString - , noCache: Map.lookup "no-cache" directives # isJust - , noStore: Map.lookup "no-store" directives # isJust - , noTransform: Map.lookup "no-transform" directives # isJust - , onlyIfCached: Map.lookup "only-if-cached" directives # isJust - , mustRevalidate: Map.lookup "must-revalidate" directives # isJust - , mustUnderstand: Map.lookup "must-understand" directives # isJust - , proxyRevalidate: Map.lookup "proxy-revalidate" directives # isJust - , private: Map.lookup "private" directives # isJust - , public: Map.lookup "public" directives # isJust - , immutable: Map.lookup "immutable" directives # isJust - , staleWhileRevalidate: Map.lookup "stale-while-revalidate" directives # isJust - , staleIfError: Map.lookup "stale-if-error" directives # isJust - } + , maxStale: Map.lookup "max-stale" directives # join >>= Int.fromString + , minFresh: Map.lookup "min-fresh" directives # join >>= Int.fromString + , sMaxAge: Map.lookup "s-maxage" directives # join >>= Int.fromString + , noCache: Map.lookup "no-cache" directives # isJust + , noStore: Map.lookup "no-store" directives # isJust + , noTransform: Map.lookup "no-transform" directives # isJust + , onlyIfCached: Map.lookup "only-if-cached" directives # isJust + , mustRevalidate: Map.lookup "must-revalidate" directives # isJust + , mustUnderstand: Map.lookup "must-understand" directives # isJust + , proxyRevalidate: Map.lookup "proxy-revalidate" directives # isJust + , private: Map.lookup "private" directives # isJust + , public: Map.lookup "public" directives # isJust + , immutable: Map.lookup "immutable" directives # isJust + , staleWhileRevalidate: Map.lookup "stale-while-revalidate" directives # + isJust + , staleIfError: Map.lookup "stale-if-error" directives # isJust + } headerValueEncode (CacheControl a) = let flag v k @@ -1373,23 +2756,23 @@ instance TypedHeader CacheControl where int Nothing _ = Nothing in Array.intercalate ", " $ Array.catMaybes - [ int a.maxAge "max-age" - , int a.maxStale "max-stale" - , int a.minFresh "min-fresh" - , int a.sMaxAge "s-maxage" - , flag a.noCache "no-cache" - , flag a.noStore "no-store" - , flag a.noTransform "no-transform" - , flag a.onlyIfCached "only-if-cached" - , flag a.mustRevalidate "must-revalidate" - , flag a.mustUnderstand "must-understand" - , flag a.proxyRevalidate "proxy-revalidate" - , flag a.private "private" - , flag a.public "public" - , flag a.immutable "immutable" - , flag a.staleWhileRevalidate "stale-while-revalidate" - , flag a.staleIfError "stale-if-error" - ] + [ int a.maxAge "max-age" + , int a.maxStale "max-stale" + , int a.minFresh "min-fresh" + , int a.sMaxAge "s-maxage" + , flag a.noCache "no-cache" + , flag a.noStore "no-store" + , flag a.noTransform "no-transform" + , flag a.onlyIfCached "only-if-cached" + , flag a.mustRevalidate "must-revalidate" + , flag a.mustUnderstand "must-understand" + , flag a.proxyRevalidate "proxy-revalidate" + , flag a.private "private" + , flag a.public "public" + , flag a.immutable "immutable" + , flag a.staleWhileRevalidate "stale-while-revalidate" + , flag a.staleIfError "stale-if-error" + ] instance TypedHeader Connection where headerName = "Connection" @@ -1399,51 +2782,78 @@ instance TypedHeader Connection where in Parse.try close <|> (commas1 headerNameParser <#> Right <#> Connection) headerValueEncode (Connection (Left ConnectionClose)) = "close" - headerValueEncode (Connection (Right as)) = as <#> String.Lower.toString # Array.NonEmpty.intercalate ", " + headerValueEncode (Connection (Right as)) = as <#> String.Lower.toString # + Array.NonEmpty.intercalate ", " instance TypedHeader ContentDisposition where headerName = "Content-Disposition" headerValueParser = let - boundary = Parse.whiteSpace *> (Parse.try (Parse.string ";") <|> Parse.try (Parse.eof *> pure "")) - inline = Parse.whiteSpace *> Parse.string "inline" *> boundary $> ContentDisposition (Either.Nested.in1 ContentDispositionInline) + boundary = Parse.whiteSpace *> + (Parse.try (Parse.string ";") <|> Parse.try (Parse.eof *> pure "")) + inline = Parse.whiteSpace *> Parse.string "inline" *> boundary $> + ContentDisposition (Either.Nested.in1 ContentDispositionInline) attachment = do - void $ Parse.whiteSpace *> Parse.string "attachment" *> boundary *> Parse.whiteSpace + void $ Parse.whiteSpace *> Parse.string "attachment" *> boundary *> + Parse.whiteSpace directives <- semis directiveParser <#> Map.fromFoldable let filename = - (Map.lookup "filename" directives <|> Map.lookup "filename*" directives) - # join - <#> Regex.replace quotesRe "" - pure $ ContentDisposition $ Either.Nested.in2 $ ContentDispositionAttachment {filename} + ( Map.lookup "filename" directives <|> Map.lookup "filename*" + directives + ) + # join + <#> Regex.replace quotesRe "" + pure $ ContentDisposition $ Either.Nested.in2 $ + ContentDispositionAttachment { filename } formData = do - void $ Parse.whiteSpace *> Parse.string "form-data" *> boundary *> Parse.whiteSpace + void $ Parse.whiteSpace *> Parse.string "form-data" *> boundary *> + Parse.whiteSpace directives <- semis directiveParser <#> Map.fromFoldable let - filename = Map.lookup "filename" directives # join <#> Regex.replace quotesRe "" - name = Map.lookup "name" directives # join <#> Regex.replace quotesRe "" - pure $ ContentDisposition $ Either.Nested.in3 $ ContentDispositionFormData {filename, name} + filename = Map.lookup "filename" directives # join <#> Regex.replace + quotesRe + "" + name = Map.lookup "name" directives # join <#> Regex.replace quotesRe + "" + pure $ ContentDisposition $ Either.Nested.in3 $ + ContentDispositionFormData { filename, name } in Parse.try inline <|> Parse.try attachment <|> Parse.try formData headerValueEncode (ContentDisposition a) = Either.Nested.either3 - (const $ [Just "inline"]) - (\(ContentDispositionAttachment {filename}) -> [Just "attachment", (\s -> "filename=\"" <> s <> "\"") <$> filename]) - (\(ContentDispositionFormData {filename, name}) -> [Just "attachment", (\s -> "filename=\"" <> s <> "\"") <$> filename, (\s -> "name=\"" <> s <> "\"") <$> name]) + (const $ [ Just "inline" ]) + ( \(ContentDispositionAttachment { filename }) -> + [ Just "attachment", (\s -> "filename=\"" <> s <> "\"") <$> filename ] + ) + ( \(ContentDispositionFormData { filename, name }) -> + [ Just "attachment" + , (\s -> "filename=\"" <> s <> "\"") <$> filename + , (\s -> "name=\"" <> s <> "\"") <$> name + ] + ) a - # Array.catMaybes - # Array.intercalate "; " + # Array.catMaybes + # Array.intercalate "; " instance TypedHeader ContentEncoding where headerName = "Content-Encoding" headerValueParser = - commas1 (Parse.whiteSpace *> (Parse.many Parse.alphaNum <#> Array.fromFoldable <#> String.CodeUnit.fromCharArray) <* Parse.whiteSpace) + commas1 + ( Parse.whiteSpace + *> + ( Parse.many Parse.alphaNum <#> Array.fromFoldable <#> + String.CodeUnit.fromCharArray + ) + <* Parse.whiteSpace + ) <#> ContentEncoding headerValueEncode (ContentEncoding as) = Array.NonEmpty.intercalate ", " as instance TypedHeader ContentLength where headerName = "Content-Length" - headerValueParser = Parse.whiteSpace *> (Parse.intDecimal <#> ContentLength) <* Parse.whiteSpace + headerValueParser = Parse.whiteSpace *> (Parse.intDecimal <#> ContentLength) + <* Parse.whiteSpace headerValueEncode (ContentLength a) = Int.toStringAs Int.decimal a instance TypedHeader ContentLocation where @@ -1457,33 +2867,55 @@ instance TypedHeader ContentRange where let startEndSize = pure (\a b c -> a /\ b /\ c) - <*> ((Parse.intDecimal <#> ByteRangeStart) <* Parse.string "-") - <*> ((Parse.intDecimal <#> ByteRangeEnd) <* Parse.string "/") - <*> (Parse.intDecimal <#> ByteRangeLength) + <*> ((Parse.intDecimal <#> ByteRangeStart) <* Parse.string "-") + <*> ((Parse.intDecimal <#> ByteRangeEnd) <* Parse.string "/") + <*> (Parse.intDecimal <#> ByteRangeLength) startEnd = pure (\a b -> a /\ b) - <*> ((Parse.intDecimal <#> ByteRangeStart) <* Parse.string "-") - <*> ((Parse.intDecimal <#> ByteRangeEnd) <* Parse.string "/" <* wildcardParser) + <*> ((Parse.intDecimal <#> ByteRangeStart) <* Parse.string "-") + <*> + ( (Parse.intDecimal <#> ByteRangeEnd) <* Parse.string "/" <* + wildcardParser + ) size = wildcardParser - *> Parse.string "/" - *> Parse.intDecimal <#> ByteRangeLength + *> Parse.string "/" + *> Parse.intDecimal + <#> ByteRangeLength in Parse.whiteSpace - *> Parse.string "bytes" - *> Parse.whiteSpace - *> ( (Parse.try startEndSize <#> Either.Nested.in1) - <|> (Parse.try startEnd <#> Either.Nested.in2) - <|> (Parse.try size <#> Either.Nested.in3) - ) - <#> ContentRange + *> Parse.string "bytes" + *> Parse.whiteSpace + *> + ( (Parse.try startEndSize <#> Either.Nested.in1) + <|> (Parse.try startEnd <#> Either.Nested.in2) + <|> (Parse.try size <#> Either.Nested.in3) + ) + <#> ContentRange headerValueEncode (ContentRange a) = Either.Nested.either3 - (\(ByteRangeStart start /\ ByteRangeEnd end /\ ByteRangeLength len) -> ["bytes ", Int.toStringAs Int.decimal start, "-", Int.toStringAs Int.decimal end, "/", Int.toStringAs Int.decimal len]) - (\(ByteRangeStart start /\ ByteRangeEnd end) -> ["bytes ", Int.toStringAs Int.decimal start, "-", Int.toStringAs Int.decimal end, "/*"]) - (\(ByteRangeLength len) -> ["bytes ", "*/", Int.toStringAs Int.decimal len]) + ( \(ByteRangeStart start /\ ByteRangeEnd end /\ ByteRangeLength len) -> + [ "bytes " + , Int.toStringAs Int.decimal start + , "-" + , Int.toStringAs Int.decimal end + , "/" + , Int.toStringAs Int.decimal len + ] + ) + ( \(ByteRangeStart start /\ ByteRangeEnd end) -> + [ "bytes " + , Int.toStringAs Int.decimal start + , "-" + , Int.toStringAs Int.decimal end + , "/*" + ] + ) + ( \(ByteRangeLength len) -> + [ "bytes ", "*/", Int.toStringAs Int.decimal len ] + ) a - # Array.fold + # Array.fold instance TypedHeader Cookie where headerName = "Cookie" @@ -1491,12 +2923,19 @@ instance TypedHeader Cookie where let cookieName = rules.token cookieValue = - (Parse.try (rules.dquote *> Parse.many rules.cookieChar <* rules.dquote) <|> Parse.many rules.cookieChar) - <#> fold - cookiePair = pure (\k v -> k /\ v) <*> (cookieName <* Parse.string "=") <*> cookieValue + ( Parse.try + (rules.dquote *> Parse.many rules.cookieChar <* rules.dquote) <|> + Parse.many rules.cookieChar + ) + <#> fold + cookiePair = pure (\k v -> k /\ v) <*> (cookieName <* Parse.string "=") + <*> cookieValue in - Parse.sepBy1 cookiePair (Parse.string "; ") <#> Array.NonEmpty.fromFoldable1 <#> Cookie - headerValueEncode (Cookie as) = as <#> (\(k /\ v) -> k <> "=" <> v) # Array.NonEmpty.intercalate "; " + Parse.sepBy1 cookiePair (Parse.string "; ") + <#> Array.NonEmpty.fromFoldable1 + <#> Cookie + headerValueEncode (Cookie as) = as <#> (\(k /\ v) -> k <> "=" <> v) # + Array.NonEmpty.intercalate "; " instance TypedHeader Date where headerName = "Date" @@ -1530,15 +2969,16 @@ instance TypedHeader IfMatch where wild = wildcardParser <#> Left <#> IfMatch etag = Parse.whiteSpace - *> Parse.optional (Parse.string "W/") - *> Parse.string "\"" - *> (Parse.anyTill (void $ Parse.string "\"") <#> fst) - <* Parse.whiteSpace + *> Parse.optional (Parse.string "W/") + *> Parse.string "\"" + *> (Parse.anyTill (void $ Parse.string "\"") <#> fst) + <* Parse.whiteSpace etags = commas1 etag <#> Right <#> IfMatch in Parse.try wild <|> Parse.try etags headerValueEncode (IfMatch (Left Wildcard)) = "*" - headerValueEncode (IfMatch (Right as)) = as <#> (\a -> "\"" <> a <> "\"") # Array.NonEmpty.intercalate ", " + headerValueEncode (IfMatch (Right as)) = as <#> (\a -> "\"" <> a <> "\"") # + Array.NonEmpty.intercalate ", " instance TypedHeader IfNoneMatch where headerName = "If-None-Match" @@ -1547,28 +2987,30 @@ instance TypedHeader IfNoneMatch where wild = wildcardParser <#> Left <#> IfNoneMatch etag a = Parse.string "\"" - *> (Parse.anyTill (void $ Parse.string "\"") <#> fst <#> a) + *> (Parse.anyTill (void $ Parse.string "\"") <#> fst <#> a) weakEtag = Parse.whiteSpace - *> Parse.string "W/" - *> etag MatchETagWeak - <* Parse.whiteSpace + *> Parse.string "W/" + *> etag MatchETagWeak + <* Parse.whiteSpace strongEtag = Parse.whiteSpace - *> Parse.string "W/" - *> etag MatchETag - <* Parse.whiteSpace - etags = commas1 (Parse.try weakEtag <|> strongEtag) <#> Right <#> IfNoneMatch + *> Parse.string "W/" + *> etag MatchETag + <* Parse.whiteSpace + etags = commas1 (Parse.try weakEtag <|> strongEtag) <#> Right <#> + IfNoneMatch in Parse.try wild <|> Parse.try etags headerValueEncode (IfNoneMatch (Left Wildcard)) = "*" headerValueEncode (IfNoneMatch (Right as)) = as - <#> ( case _ of + <#> + ( case _ of MatchETag a -> "\"" <> a <> "\"" MatchETagWeak a -> "W/\"" <> a <> "\"" ) - # Array.NonEmpty.intercalate ", " + # Array.NonEmpty.intercalate ", " instance TypedHeader IfModifiedSince where headerName = "If-Modified-Since" @@ -1582,12 +3024,12 @@ instance TypedHeader IfRange where dt = datetimeParser <#> Left <#> IfRange etag = Parse.whiteSpace - *> Parse.string "\"" - *> Parse.anyTill (Parse.string "\"") - <* Parse.whiteSpace - <#> fst - <#> Right - <#> IfRange + *> Parse.string "\"" + *> Parse.anyTill (Parse.string "\"") + <* Parse.whiteSpace + <#> fst + <#> Right + <#> IfRange in Parse.try dt <|> Parse.try etag headerValueEncode (IfRange (Left a)) = printDateTime a @@ -1600,7 +3042,7 @@ instance TypedHeader IfUnmodifiedSince where instance TypedHeader LastModified where headerName = "Last-Modified" - headerValueParser = datetimeParser <#> LastModified + headerValueParser = datetimeParser <#> LastModified headerValueEncode (LastModified a) = printDateTime a instance TypedHeader Origin where @@ -1612,7 +3054,10 @@ instance TypedHeader ProxyAuthorization where headerName = "Proxy-Authorization" headerValueParser = let - scheme = (Parse.anyTill (void (Parse.try Parse.space) <|> Parse.eof) <#> fst <#> AuthScheme) + scheme = + ( Parse.anyTill (void (Parse.try Parse.space) <|> Parse.eof) <#> fst <#> + AuthScheme + ) in pure ProxyAuthorization <*> scheme <*> (Parse.rest <#> String.trim) headerValueEncode (ProxyAuthorization (AuthScheme s) v) = s <> " " <> v @@ -1624,23 +3069,29 @@ instance TypedHeader Range where int = Parse.intDecimal dash = Parse.string "-" rangeSpecStart = int <* dash <#> ByteRangeStart - rangeSpecStartEnd = pure (\a b -> a /\ b) <*> (int <* dash <#> ByteRangeStart) <*> (int <#> ByteRangeEnd) + rangeSpecStartEnd = pure (\a b -> a /\ b) + <*> (int <* dash <#> ByteRangeStart) + <*> (int <#> ByteRangeEnd) rangeSpecSuffix = dash *> int <#> ByteRangeLength rangeSpec = Parse.try (rangeSpecStartEnd <#> Either.Nested.in2) - <|> Parse.try (rangeSpecSuffix <#> Either.Nested.in3) - <|> (rangeSpecStart <#> Either.Nested.in1) + <|> Parse.try (rangeSpecSuffix <#> Either.Nested.in3) + <|> (rangeSpecStart <#> Either.Nested.in1) in commas1 rangeSpec <#> Range headerValueEncode (Range as) = as - <#> ( - Either.Nested.either3 - (\(ByteRangeStart a) -> Int.toStringAs Int.decimal a <> "-") - (\(ByteRangeStart a /\ ByteRangeEnd b) -> Int.toStringAs Int.decimal a <> "-" <> Int.toStringAs Int.decimal b) - (\(ByteRangeLength b) -> "-" <> Int.toStringAs Int.decimal b) - ) - # Array.NonEmpty.intercalate ", " + <#> + ( Either.Nested.either3 + (\(ByteRangeStart a) -> Int.toStringAs Int.decimal a <> "-") + ( \(ByteRangeStart a /\ ByteRangeEnd b) -> + Int.toStringAs Int.decimal a <> "-" <> Int.toStringAs + Int.decimal + b + ) + (\(ByteRangeLength b) -> "-" <> Int.toStringAs Int.decimal b) + ) + # Array.NonEmpty.intercalate ", " instance TypedHeader Referer where headerName = "Referer" @@ -1652,34 +3103,42 @@ instance TypedHeader ReferrerPolicy where headerValueParser = let noReferrer = Parse.string "no-referrer" $> ReferrerPolicyNoReferrer - noReferrerWhenDowngrade = Parse.string "no-referrer-when-downgrade" $> ReferrerPolicyNoReferrerWhenDowngrade + noReferrerWhenDowngrade = Parse.string "no-referrer-when-downgrade" $> + ReferrerPolicyNoReferrerWhenDowngrade origin = Parse.string "origin" $> ReferrerPolicyOrigin - originWhenCrossOrigin = Parse.string "origin-when-cross-origin" $> ReferrerPolicyOriginWhenCrossOrigin + originWhenCrossOrigin = Parse.string "origin-when-cross-origin" $> + ReferrerPolicyOriginWhenCrossOrigin sameOrigin = Parse.string "same-origin" $> ReferrerPolicySameOrigin strictOrigin = Parse.string "strict-origin" $> ReferrerPolicyStrictOrigin - strictOriginWhenCrossOrigin = Parse.string "strict-origin-when-cross-origin" $> ReferrerPolicyStrictOriginWhenCrossOrigin + strictOriginWhenCrossOrigin = + Parse.string "strict-origin-when-cross-origin" $> + ReferrerPolicyStrictOriginWhenCrossOrigin unsafeURL = Parse.string "unsafe-url" $> ReferrerPolicyUnsafeURL in Parse.try noReferrer - <|> Parse.try noReferrerWhenDowngrade - <|> Parse.try origin - <|> Parse.try originWhenCrossOrigin - <|> Parse.try sameOrigin - <|> Parse.try strictOrigin - <|> Parse.try strictOriginWhenCrossOrigin - <|> unsafeURL + <|> Parse.try noReferrerWhenDowngrade + <|> Parse.try origin + <|> Parse.try originWhenCrossOrigin + <|> Parse.try sameOrigin + <|> Parse.try strictOrigin + <|> Parse.try strictOriginWhenCrossOrigin + <|> unsafeURL headerValueEncode ReferrerPolicyNoReferrer = "no-referrer" - headerValueEncode ReferrerPolicyNoReferrerWhenDowngrade = "no-referrer-when-downgrade" + headerValueEncode ReferrerPolicyNoReferrerWhenDowngrade = + "no-referrer-when-downgrade" headerValueEncode ReferrerPolicyOrigin = "origin" - headerValueEncode ReferrerPolicyOriginWhenCrossOrigin = "origin-when-cross-origin" + headerValueEncode ReferrerPolicyOriginWhenCrossOrigin = + "origin-when-cross-origin" headerValueEncode ReferrerPolicySameOrigin = "same-origin" headerValueEncode ReferrerPolicyStrictOrigin = "strict-origin" - headerValueEncode ReferrerPolicyStrictOriginWhenCrossOrigin = "strict-origin-when-cross-origin" + headerValueEncode ReferrerPolicyStrictOriginWhenCrossOrigin = + "strict-origin-when-cross-origin" headerValueEncode ReferrerPolicyUnsafeURL = "unsafe-url" instance TypedHeader RetryAfter where headerName = "Retry-After" - headerValueParser = Parse.try (datetimeParser <#> Left <#> RetryAfter) <|> Parse.try (Parse.intDecimal <#> Right <#> RetryAfter) + headerValueParser = Parse.try (datetimeParser <#> Left <#> RetryAfter) <|> + Parse.try (Parse.intDecimal <#> Right <#> RetryAfter) headerValueEncode (RetryAfter (Left a)) = printDateTime a headerValueEncode (RetryAfter (Right a)) = Int.toStringAs Int.decimal a @@ -1696,7 +3155,8 @@ instance TypedHeader SecWebsocketAccept where instance TypedHeader SecWebsocketVersion where headerName = "Sec-WebSocket-Version" headerValueParser = commas1 (Parse.intDecimal) <#> SecWebsocketVersion - headerValueEncode (SecWebsocketVersion as) = as <#> Int.toStringAs Int.decimal # Array.NonEmpty.intercalate ", " + headerValueEncode (SecWebsocketVersion as) = as <#> Int.toStringAs Int.decimal + # Array.NonEmpty.intercalate ", " instance TypedHeader Server where headerName = "Server" @@ -1725,9 +3185,9 @@ instance TypedHeader StrictTransportSecurity where int Nothing _ = Nothing in Array.intercalate ", " $ Array.catMaybes - [ int a.maxAge "max-age" - , flag a.includeSubdomains "includeSubDomains" - ] + [ int a.maxAge "max-age" + , flag a.includeSubdomains "includeSubDomains" + ] instance TypedHeader TE where headerName = "TE" @@ -1751,6 +3211,8 @@ instance TypedHeader UserAgent where instance TypedHeader Vary where headerName = "Vary" - headerValueParser = Parse.try (wildcardParser <#> Left <#> Vary) <|> Parse.try (commas1 headerNameParser <#> Right <#> Vary) + headerValueParser = Parse.try (wildcardParser <#> Left <#> Vary) <|> Parse.try + (commas1 headerNameParser <#> Right <#> Vary) headerValueEncode (Vary (Left _)) = "*" - headerValueEncode (Vary (Right a)) = a <#> String.Lower.toString # Array.NonEmpty.intercalate ", " + headerValueEncode (Vary (Right a)) = a <#> String.Lower.toString # + Array.NonEmpty.intercalate ", " diff --git a/src/Axon.Node.purs b/src/Axon.Node.purs new file mode 100644 index 0000000..7a78d47 --- /dev/null +++ b/src/Axon.Node.purs @@ -0,0 +1 @@ +module Axon.Node where diff --git a/src/Axon.Request.Handler.Default.purs b/src/Axon.Request.Handler.Default.purs new file mode 100644 index 0000000..c456a50 --- /dev/null +++ b/src/Axon.Request.Handler.Default.purs @@ -0,0 +1,12 @@ +module Axon.Request.Handler.Default where + +import Prelude + +import Axon.Request.Handler (Handler(..)) +import Axon.Response (Response) +import Axon.Response as Response +import Data.Either (Either(..)) +import Effect.Aff.Class (class MonadAff) + +notFound :: forall m. MonadAff m => Handler m Response +notFound = Handler $ const $ pure $ Right $ Response.fromStatus 404 diff --git a/src/Axon.Request.Handler.purs b/src/Axon.Request.Handler.purs new file mode 100644 index 0000000..c2fe8d6 --- /dev/null +++ b/src/Axon.Request.Handler.purs @@ -0,0 +1,54 @@ +module Axon.Request.Handler where + +import Prelude + +import Axon.Request (Request) +import Axon.Request.Parts.Class + ( class RequestParts + , ExtractError(..) + , extractRequestParts + ) +import Control.Monad.Except (ExceptT(..), runExceptT) +import Data.Either (Either(..)) +import Data.Newtype (class Newtype) +import Effect.Aff.Class (class MonadAff, liftAff) + +newtype Handler m a = Handler (Request -> m (Either ExtractError a)) + +derive instance Newtype (Handler m a) _ + +or :: + forall m a b r. + RequestHandler a m r => + RequestHandler b m r => + a -> + b -> + Handler m r +or a b = toHandler a <> toHandler b + +instance Monad m => Semigroup (Handler m a) where + append (Handler a) (Handler b) = Handler \req -> + a req >>= case _ of + Left ExtractNext -> b req + a' -> pure a' + +class MonadAff m <= RequestHandler a m b | a -> b m where + toHandler :: a -> Handler m b + invokeHandler :: a -> Request -> m (Either ExtractError b) + +instance (MonadAff m) => RequestHandler (Handler m b) m b where + toHandler = identity + invokeHandler (Handler f) = f +else instance + ( MonadAff m + , RequestHandler f m b + , RequestParts a + ) => + RequestHandler (a -> f) m b where + toHandler f = Handler $ invokeHandler f + invokeHandler f req = runExceptT do + a <- ExceptT $ liftAff $ extractRequestParts @a req + ExceptT $ invokeHandler (f a) req +else instance (MonadAff m) => RequestHandler (m a) m a where + toHandler m = Handler $ const $ m <#> Right + invokeHandler m _ = m <#> Right diff --git a/src/Axon.Request.Method.purs b/src/Axon.Request.Method.purs index 45303db..93506dd 100644 --- a/src/Axon.Request.Method.purs +++ b/src/Axon.Request.Method.purs @@ -7,7 +7,16 @@ import Data.Maybe (Maybe(..)) import Data.Show.Generic (genericShow) import Data.String as String -data Method = GET | POST | PUT | PATCH | DELETE | OPTIONS | TRACE | CONNECT | HEAD +data Method + = GET + | POST + | PUT + | PATCH + | DELETE + | OPTIONS + | TRACE + | CONNECT + | HEAD derive instance Generic Method _ derive instance Eq Method diff --git a/src/Axon.Request.Parts.Class.purs b/src/Axon.Request.Parts.Class.purs index 58d7c88..c90b25f 100644 --- a/src/Axon.Request.Parts.Class.purs +++ b/src/Axon.Request.Parts.Class.purs @@ -1,8 +1,9 @@ module Axon.Request.Parts.Class ( class RequestParts - , class RequestHandler - , invokeHandler , extractRequestParts + , Try(..) + , tryEither + , tryToEither , ExtractError(..) , module Parts.Header , module Parts.Method @@ -21,30 +22,70 @@ import Axon.Request.Parts.Body (Json(..), Stream(..)) import Axon.Request.Parts.Body (Json(..), Stream(..)) as Parts.Body import Axon.Request.Parts.Header (Header(..), HeaderMap(..)) import Axon.Request.Parts.Header (Header(..), HeaderMap(..)) as Parts.Header -import Axon.Request.Parts.Method (Connect(..), Delete(..), Get(..), Options(..), Patch(..), Post(..), Put(..), Trace(..)) -import Axon.Request.Parts.Method (Get(..), Post(..), Put(..), Patch(..), Delete(..), Trace(..), Options(..), Connect(..)) as Parts.Method +import Axon.Request.Parts.Method + ( Connect(..) + , Delete(..) + , Get(..) + , Options(..) + , Patch(..) + , Post(..) + , Put(..) + , Trace(..) + ) +import Axon.Request.Parts.Method + ( Get(..) + , Post(..) + , Put(..) + , Patch(..) + , Delete(..) + , Trace(..) + , Options(..) + , Connect(..) + ) as Parts.Method import Axon.Request.Parts.Path (Path(..)) as Path.Parts -import Axon.Request.Parts.Path (class DiscardTupledUnits, class PathParts, Path(..), discardTupledUnits, extractPathParts) +import Axon.Request.Parts.Path + ( class DiscardTupledUnits + , class PathParts + , Path(..) + , discardTupledUnits + , extractPathParts + ) import Control.Monad.Error.Class (liftEither, liftMaybe, throwError) import Control.Monad.Except (ExceptT(..), runExceptT) import Data.Argonaut.Decode (class DecodeJson, decodeJson) import Data.Argonaut.Decode.Error (printJsonDecodeError) import Data.Array as Array import Data.Bifunctor (bimap, lmap) -import Data.Either (Either(..), note) +import Data.Either (Either(..), hush, note) import Data.Generic.Rep (class Generic) import Data.Map as Map +import Data.Maybe (Maybe) import Data.Show.Generic (genericShow) import Data.String.Lower as String.Lower import Data.Tuple.Nested (type (/\), (/\)) import Data.URL as URL import Effect.Aff (Aff) -import Effect.Aff.Class (class MonadAff, liftAff) import Effect.Class (liftEffect) import Node.Buffer (Buffer) import Parsing (runParser) import Parsing.String (parseErrorHuman) +data Try err ok = Err err | Ok ok + +derive instance Generic (Try a b) _ +derive instance (Eq a, Eq b) => Eq (Try a b) + +instance (Show a, Show b) => Show (Try a b) where + show = genericShow + +tryEither :: forall a b. Either a b -> Try a b +tryEither (Left a) = Err a +tryEither (Right b) = Ok b + +tryToEither :: forall a b. Try a b -> Either a b +tryToEither (Err a) = Left a +tryToEither (Ok b) = Right b + data ExtractError = ExtractError String | ExtractNext @@ -52,7 +93,8 @@ data ExtractError derive instance Generic ExtractError _ derive instance Eq ExtractError -instance Show ExtractError where show = genericShow +instance Show ExtractError where + show = genericShow extractMethod :: forall a. @@ -64,16 +106,6 @@ extractMethod a method r = runExceptT do when (Request.method r /= method) $ throwError ExtractNext pure a -class MonadAff m <= RequestHandler a m b | a -> b m where - invokeHandler :: Request -> a -> m (Either ExtractError b) - -instance (MonadAff m, RequestHandler f m b, RequestParts a) => RequestHandler (a -> f) m b where - invokeHandler req f = runExceptT do - a <- ExceptT $ liftAff $ extractRequestParts @a req - ExceptT $ invokeHandler req (f a) -else instance (MonadAff m) => RequestHandler (m a) m a where - invokeHandler _ m = m <#> Right - class RequestParts a where extractRequestParts :: Request -> Aff (Either ExtractError a) @@ -88,8 +120,19 @@ instance RequestParts String where Request.bodyString r <#> lmap (const $ ExtractBadRequest "Expected body to be valid UTF-8") -instance RequestParts (Either Request.BodyStringError String) where - extractRequestParts r = Request.bodyString r <#> Right +instance RequestParts (Try Request.BodyStringError String) where + extractRequestParts r = Request.bodyString r <#> tryEither <#> Right + +instance (RequestParts a, RequestParts b) => RequestParts (Either a b) where + extractRequestParts r = + extractRequestParts @a r + >>= + case _ of + Right a' -> pure $ Right $ Left a' + _ -> extractRequestParts @b r <#> map Right + +instance (RequestParts a) => RequestParts (Maybe a) where + extractRequestParts r = extractRequestParts @a r <#> hush <#> Right instance TypedHeader a => RequestParts (Header a) where extractRequestParts r = runExceptT do @@ -98,7 +141,12 @@ instance TypedHeader a => RequestParts (Header a) where # Map.lookup (String.Lower.fromString $ headerName @a) # liftMaybe ExtractNext runParser value (headerValueParser @a) - # bimap (ExtractBadRequest <<< Array.intercalate "\n" <<< parseErrorHuman value 5) Header + # bimap + ( ExtractBadRequest <<< Array.intercalate "\n" <<< parseErrorHuman + value + 5 + ) + Header # liftEither instance RequestParts HeaderMap where @@ -112,7 +160,8 @@ instance (PathParts a b, DiscardTupledUnits b c) => RequestParts (Path a c) wher URL.PathRelative a -> a _ -> [] extract = extractPathParts @a @b (Request.url r) - ensureConsumed (leftover /\ x) = when (not $ Array.null leftover) (throwError ExtractNext) $> x + ensureConsumed (leftover /\ x) = + when (not $ Array.null leftover) (throwError ExtractNext) $> x in segments # extract diff --git a/src/Axon.Request.Parts.Header.purs b/src/Axon.Request.Parts.Header.purs index e102be9..59d26a0 100644 --- a/src/Axon.Request.Parts.Header.purs +++ b/src/Axon.Request.Parts.Header.purs @@ -8,6 +8,7 @@ import Data.Newtype (class Newtype) import Data.String.Lower (StringLower) newtype Header a = Header a + derive instance Generic (Header a) _ derive instance Newtype (Header a) _ derive newtype instance (Eq a) => Eq (Header a) @@ -15,6 +16,7 @@ derive newtype instance (Ord a) => Ord (Header a) derive newtype instance (Show a) => Show (Header a) newtype HeaderMap = HeaderMap (Map StringLower String) + derive instance Generic HeaderMap _ derive instance Newtype HeaderMap _ derive newtype instance Eq HeaderMap diff --git a/src/Axon.purs b/src/Axon.purs new file mode 100644 index 0000000..32b8438 --- /dev/null +++ b/src/Axon.purs @@ -0,0 +1,2 @@ +module Axon where + diff --git a/src/Data.MIME.purs b/src/Data.MIME.purs index 2701533..23937e9 100644 --- a/src/Data.MIME.purs +++ b/src/Data.MIME.purs @@ -6,7 +6,79 @@ import Data.Eq.Generic (genericEq) import Data.Generic.Rep (class Generic) import Data.Show.Generic (genericShow) -data MIME = Other String | Aac | Abw | Arc | Avif | Avi | Azw | Bin | Bmp | Bz | Bz2 | Cda | Csh | Css | Csv | Doc | Docx | Eot | Epub | Gz | Gif | Html | Ico | Ics | Jar | Jpeg | Js | Json | Jsonld | Midi | Mp3 | Mp4 | Mpeg | Mpkg | Odp | Ods | Odt | Oga | Ogv | Ogx | Opus | Otf | Png | Pdf | Php | Ppt | Pptx | Rar | Rtf | Sh | Svg | Tar | Tif | Ts | Ttf | Txt | Vsd | Wav | Weba | Webm | Webp | Woff | Woff2 | Xhtml | Xls | Xlsx | Xml | Xul | Zip | Video3gp | Video3g2 | Archive7z +data MIME + = Other String + | Aac + | Abw + | Arc + | Avif + | Avi + | Azw + | Bin + | Bmp + | Bz + | Bz2 + | Cda + | Csh + | Css + | Csv + | Doc + | Docx + | Eot + | Epub + | Gz + | Gif + | Html + | Ico + | Ics + | Jar + | Jpeg + | Js + | Json + | Jsonld + | Midi + | Mp3 + | Mp4 + | Mpeg + | Mpkg + | Odp + | Ods + | Odt + | Oga + | Ogv + | Ogx + | Opus + | Otf + | Png + | Pdf + | Php + | Ppt + | Pptx + | Rar + | Rtf + | Sh + | Svg + | Tar + | Tif + | Ts + | Ttf + | Txt + | Vsd + | Wav + | Weba + | Webm + | Webp + | Woff + | Woff2 + | Xhtml + | Xls + | Xlsx + | Xml + | Xul + | Zip + | Video3gp + | Video3g2 + | Archive7z derive instance Generic MIME _ instance Show MIME where @@ -32,7 +104,8 @@ toString Csh = "application/x-csh" toString Css = "text/css" toString Csv = "text/csv" toString Doc = "application/msword" -toString Docx = "application/vnd.openxmlformats-officedocument.wordprocessingml.document" +toString Docx = + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" toString Eot = "application/vnd.ms-fontobject" toString Epub = "application/epub+zip" toString Gz = "application/gzip" @@ -62,7 +135,8 @@ toString Png = "image/png" toString Pdf = "application/pdf" toString Php = "application/x-httpd-php" toString Ppt = "application/vnd.ms-powerpoint" -toString Pptx = "application/vnd.openxmlformats-officedocument.presentationml.presentation" +toString Pptx = + "application/vnd.openxmlformats-officedocument.presentationml.presentation" toString Rar = "application/vnd.rar" toString Rtf = "application/rtf" toString Sh = "application/x-sh" @@ -81,7 +155,8 @@ toString Woff = "font/woff" toString Woff2 = "font/woff2" toString Xhtml = "application/xhtml+xml" toString Xls = "application/vnd.ms-excel" -toString Xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" +toString Xlsx = + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" toString Xml = "application/xml" toString Xul = "application/vnd.mozilla.xul+xml" toString Zip = "application/zip" @@ -105,7 +180,9 @@ fromString "application/x-csh" = Csh fromString "text/css" = Css fromString "text/csv" = Csv fromString "application/msword" = Doc -fromString "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = Docx +fromString + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = + Docx fromString "application/vnd.ms-fontobject" = Eot fromString "application/epub+zip" = Epub fromString "application/gzip" = Gz @@ -135,7 +212,9 @@ fromString "image/png" = Png fromString "application/pdf" = Pdf fromString "application/x-httpd-php" = Php fromString "application/vnd.ms-powerpoint" = Ppt -fromString "application/vnd.openxmlformats-officedocument.presentationml.presentation" = Pptx +fromString + "application/vnd.openxmlformats-officedocument.presentationml.presentation" = + Pptx fromString "application/vnd.rar" = Rar fromString "application/rtf" = Rtf fromString "application/x-sh" = Sh @@ -154,7 +233,8 @@ fromString "font/woff" = Woff fromString "font/woff2" = Woff2 fromString "application/xhtml+xml" = Xhtml fromString "application/vnd.ms-excel" = Xls -fromString "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = Xlsx +fromString "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = + Xlsx fromString "application/xml" = Xml fromString "application/vnd.mozilla.xul+xml" = Xul fromString "application/zip" = Zip diff --git a/src/Type.MIME.purs b/src/Type.MIME.purs index 369484b..64e945c 100644 --- a/src/Type.MIME.purs +++ b/src/Type.MIME.purs @@ -12,710 +12,852 @@ class TypelevelMIME a where value :: MIME.MIME data Aac = Aac + derive instance Generic Aac _ derive instance Eq Aac instance Show Aac where show = genericShow + instance TypelevelMIME Aac where fromValue MIME.Aac = Just Aac fromValue _ = Nothing value = MIME.Aac - + data Abw = Abw + derive instance Generic Abw _ derive instance Eq Abw instance Show Abw where show = genericShow + instance TypelevelMIME Abw where fromValue MIME.Abw = Just Abw fromValue _ = Nothing value = MIME.Abw - + data Arc = Arc + derive instance Generic Arc _ derive instance Eq Arc instance Show Arc where show = genericShow + instance TypelevelMIME Arc where fromValue MIME.Arc = Just Arc fromValue _ = Nothing value = MIME.Arc - + data Avif = Avif + derive instance Generic Avif _ derive instance Eq Avif instance Show Avif where show = genericShow + instance TypelevelMIME Avif where fromValue MIME.Avif = Just Avif fromValue _ = Nothing value = MIME.Avif - + data Avi = Avi + derive instance Generic Avi _ derive instance Eq Avi instance Show Avi where show = genericShow + instance TypelevelMIME Avi where fromValue MIME.Avi = Just Avi fromValue _ = Nothing value = MIME.Avi - + data Azw = Azw + derive instance Generic Azw _ derive instance Eq Azw instance Show Azw where show = genericShow + instance TypelevelMIME Azw where fromValue MIME.Azw = Just Azw fromValue _ = Nothing value = MIME.Azw - + data Bin = Bin + derive instance Generic Bin _ derive instance Eq Bin instance Show Bin where show = genericShow + instance TypelevelMIME Bin where fromValue MIME.Bin = Just Bin fromValue _ = Nothing value = MIME.Bin - + data Bmp = Bmp + derive instance Generic Bmp _ derive instance Eq Bmp instance Show Bmp where show = genericShow + instance TypelevelMIME Bmp where fromValue MIME.Bmp = Just Bmp fromValue _ = Nothing value = MIME.Bmp - + data Bz = Bz + derive instance Generic Bz _ derive instance Eq Bz instance Show Bz where show = genericShow + instance TypelevelMIME Bz where fromValue MIME.Bz = Just Bz fromValue _ = Nothing value = MIME.Bz - + data Bz2 = Bz2 + derive instance Generic Bz2 _ derive instance Eq Bz2 instance Show Bz2 where show = genericShow + instance TypelevelMIME Bz2 where fromValue MIME.Bz2 = Just Bz2 fromValue _ = Nothing value = MIME.Bz2 - + data Cda = Cda + derive instance Generic Cda _ derive instance Eq Cda instance Show Cda where show = genericShow + instance TypelevelMIME Cda where fromValue MIME.Cda = Just Cda fromValue _ = Nothing value = MIME.Cda - + data Csh = Csh + derive instance Generic Csh _ derive instance Eq Csh instance Show Csh where show = genericShow + instance TypelevelMIME Csh where fromValue MIME.Csh = Just Csh fromValue _ = Nothing value = MIME.Csh - + data Css = Css + derive instance Generic Css _ derive instance Eq Css instance Show Css where show = genericShow + instance TypelevelMIME Css where fromValue MIME.Css = Just Css fromValue _ = Nothing value = MIME.Css - + data Csv = Csv + derive instance Generic Csv _ derive instance Eq Csv instance Show Csv where show = genericShow + instance TypelevelMIME Csv where fromValue MIME.Csv = Just Csv fromValue _ = Nothing value = MIME.Csv - + data Doc = Doc + derive instance Generic Doc _ derive instance Eq Doc instance Show Doc where show = genericShow + instance TypelevelMIME Doc where fromValue MIME.Doc = Just Doc fromValue _ = Nothing value = MIME.Doc - + data Docx = Docx + derive instance Generic Docx _ derive instance Eq Docx instance Show Docx where show = genericShow + instance TypelevelMIME Docx where fromValue MIME.Docx = Just Docx fromValue _ = Nothing value = MIME.Docx - + data Eot = Eot + derive instance Generic Eot _ derive instance Eq Eot instance Show Eot where show = genericShow + instance TypelevelMIME Eot where fromValue MIME.Eot = Just Eot fromValue _ = Nothing value = MIME.Eot - + data Epub = Epub + derive instance Generic Epub _ derive instance Eq Epub instance Show Epub where show = genericShow + instance TypelevelMIME Epub where fromValue MIME.Epub = Just Epub fromValue _ = Nothing value = MIME.Epub - + data Gz = Gz + derive instance Generic Gz _ derive instance Eq Gz instance Show Gz where show = genericShow + instance TypelevelMIME Gz where fromValue MIME.Gz = Just Gz fromValue _ = Nothing value = MIME.Gz - + data Gif = Gif + derive instance Generic Gif _ derive instance Eq Gif instance Show Gif where show = genericShow + instance TypelevelMIME Gif where fromValue MIME.Gif = Just Gif fromValue _ = Nothing value = MIME.Gif - + data Html = Html + derive instance Generic Html _ derive instance Eq Html instance Show Html where show = genericShow + instance TypelevelMIME Html where fromValue MIME.Html = Just Html fromValue _ = Nothing value = MIME.Html - + data Ico = Ico + derive instance Generic Ico _ derive instance Eq Ico instance Show Ico where show = genericShow + instance TypelevelMIME Ico where fromValue MIME.Ico = Just Ico fromValue _ = Nothing value = MIME.Ico - + data Ics = Ics + derive instance Generic Ics _ derive instance Eq Ics instance Show Ics where show = genericShow + instance TypelevelMIME Ics where fromValue MIME.Ics = Just Ics fromValue _ = Nothing value = MIME.Ics - + data Jar = Jar + derive instance Generic Jar _ derive instance Eq Jar instance Show Jar where show = genericShow + instance TypelevelMIME Jar where fromValue MIME.Jar = Just Jar fromValue _ = Nothing value = MIME.Jar - + data Jpeg = Jpeg + derive instance Generic Jpeg _ derive instance Eq Jpeg instance Show Jpeg where show = genericShow + instance TypelevelMIME Jpeg where fromValue MIME.Jpeg = Just Jpeg fromValue _ = Nothing value = MIME.Jpeg - + data Js = Js + derive instance Generic Js _ derive instance Eq Js instance Show Js where show = genericShow + instance TypelevelMIME Js where fromValue MIME.Js = Just Js fromValue _ = Nothing value = MIME.Js - + data Json = Json + derive instance Generic Json _ derive instance Eq Json instance Show Json where show = genericShow + instance TypelevelMIME Json where fromValue MIME.Json = Just Json fromValue _ = Nothing value = MIME.Json - + data Jsonld = Jsonld + derive instance Generic Jsonld _ derive instance Eq Jsonld instance Show Jsonld where show = genericShow + instance TypelevelMIME Jsonld where fromValue MIME.Jsonld = Just Jsonld fromValue _ = Nothing value = MIME.Jsonld - + data Midi = Midi + derive instance Generic Midi _ derive instance Eq Midi instance Show Midi where show = genericShow + instance TypelevelMIME Midi where fromValue MIME.Midi = Just Midi fromValue _ = Nothing value = MIME.Midi - + data Mp3 = Mp3 + derive instance Generic Mp3 _ derive instance Eq Mp3 instance Show Mp3 where show = genericShow + instance TypelevelMIME Mp3 where fromValue MIME.Mp3 = Just Mp3 fromValue _ = Nothing value = MIME.Mp3 - + data Mp4 = Mp4 + derive instance Generic Mp4 _ derive instance Eq Mp4 instance Show Mp4 where show = genericShow + instance TypelevelMIME Mp4 where fromValue MIME.Mp4 = Just Mp4 fromValue _ = Nothing value = MIME.Mp4 - + data Mpeg = Mpeg + derive instance Generic Mpeg _ derive instance Eq Mpeg instance Show Mpeg where show = genericShow + instance TypelevelMIME Mpeg where fromValue MIME.Mpeg = Just Mpeg fromValue _ = Nothing value = MIME.Mpeg - + data Mpkg = Mpkg + derive instance Generic Mpkg _ derive instance Eq Mpkg instance Show Mpkg where show = genericShow + instance TypelevelMIME Mpkg where fromValue MIME.Mpkg = Just Mpkg fromValue _ = Nothing value = MIME.Mpkg - + data Odp = Odp + derive instance Generic Odp _ derive instance Eq Odp instance Show Odp where show = genericShow + instance TypelevelMIME Odp where fromValue MIME.Odp = Just Odp fromValue _ = Nothing value = MIME.Odp - + data Ods = Ods + derive instance Generic Ods _ derive instance Eq Ods instance Show Ods where show = genericShow + instance TypelevelMIME Ods where fromValue MIME.Ods = Just Ods fromValue _ = Nothing value = MIME.Ods - + data Odt = Odt + derive instance Generic Odt _ derive instance Eq Odt instance Show Odt where show = genericShow + instance TypelevelMIME Odt where fromValue MIME.Odt = Just Odt fromValue _ = Nothing value = MIME.Odt - + data Oga = Oga + derive instance Generic Oga _ derive instance Eq Oga instance Show Oga where show = genericShow + instance TypelevelMIME Oga where fromValue MIME.Oga = Just Oga fromValue _ = Nothing value = MIME.Oga - + data Ogv = Ogv + derive instance Generic Ogv _ derive instance Eq Ogv instance Show Ogv where show = genericShow + instance TypelevelMIME Ogv where fromValue MIME.Ogv = Just Ogv fromValue _ = Nothing value = MIME.Ogv - + data Ogx = Ogx + derive instance Generic Ogx _ derive instance Eq Ogx instance Show Ogx where show = genericShow + instance TypelevelMIME Ogx where fromValue MIME.Ogx = Just Ogx fromValue _ = Nothing value = MIME.Ogx - + data Opus = Opus + derive instance Generic Opus _ derive instance Eq Opus instance Show Opus where show = genericShow + instance TypelevelMIME Opus where fromValue MIME.Opus = Just Opus fromValue _ = Nothing value = MIME.Opus - + data Otf = Otf + derive instance Generic Otf _ derive instance Eq Otf instance Show Otf where show = genericShow + instance TypelevelMIME Otf where fromValue MIME.Otf = Just Otf fromValue _ = Nothing value = MIME.Otf - + data Png = Png + derive instance Generic Png _ derive instance Eq Png instance Show Png where show = genericShow + instance TypelevelMIME Png where fromValue MIME.Png = Just Png fromValue _ = Nothing value = MIME.Png - + data Pdf = Pdf + derive instance Generic Pdf _ derive instance Eq Pdf instance Show Pdf where show = genericShow + instance TypelevelMIME Pdf where fromValue MIME.Pdf = Just Pdf fromValue _ = Nothing value = MIME.Pdf - + data Php = Php + derive instance Generic Php _ derive instance Eq Php instance Show Php where show = genericShow + instance TypelevelMIME Php where fromValue MIME.Php = Just Php fromValue _ = Nothing value = MIME.Php - + data Ppt = Ppt + derive instance Generic Ppt _ derive instance Eq Ppt instance Show Ppt where show = genericShow + instance TypelevelMIME Ppt where fromValue MIME.Ppt = Just Ppt fromValue _ = Nothing value = MIME.Ppt - + data Pptx = Pptx + derive instance Generic Pptx _ derive instance Eq Pptx instance Show Pptx where show = genericShow + instance TypelevelMIME Pptx where fromValue MIME.Pptx = Just Pptx fromValue _ = Nothing value = MIME.Pptx - + data Rar = Rar + derive instance Generic Rar _ derive instance Eq Rar instance Show Rar where show = genericShow + instance TypelevelMIME Rar where fromValue MIME.Rar = Just Rar fromValue _ = Nothing value = MIME.Rar - + data Rtf = Rtf + derive instance Generic Rtf _ derive instance Eq Rtf instance Show Rtf where show = genericShow + instance TypelevelMIME Rtf where fromValue MIME.Rtf = Just Rtf fromValue _ = Nothing value = MIME.Rtf - + data Sh = Sh + derive instance Generic Sh _ derive instance Eq Sh instance Show Sh where show = genericShow + instance TypelevelMIME Sh where fromValue MIME.Sh = Just Sh fromValue _ = Nothing value = MIME.Sh - + data Svg = Svg + derive instance Generic Svg _ derive instance Eq Svg instance Show Svg where show = genericShow + instance TypelevelMIME Svg where fromValue MIME.Svg = Just Svg fromValue _ = Nothing value = MIME.Svg - + data Tar = Tar + derive instance Generic Tar _ derive instance Eq Tar instance Show Tar where show = genericShow + instance TypelevelMIME Tar where fromValue MIME.Tar = Just Tar fromValue _ = Nothing value = MIME.Tar - + data Tif = Tif + derive instance Generic Tif _ derive instance Eq Tif instance Show Tif where show = genericShow + instance TypelevelMIME Tif where fromValue MIME.Tif = Just Tif fromValue _ = Nothing value = MIME.Tif - + data Ts = Ts + derive instance Generic Ts _ derive instance Eq Ts instance Show Ts where show = genericShow + instance TypelevelMIME Ts where fromValue MIME.Ts = Just Ts fromValue _ = Nothing value = MIME.Ts - + data Ttf = Ttf + derive instance Generic Ttf _ derive instance Eq Ttf instance Show Ttf where show = genericShow + instance TypelevelMIME Ttf where fromValue MIME.Ttf = Just Ttf fromValue _ = Nothing value = MIME.Ttf - + data Txt = Txt + derive instance Generic Txt _ derive instance Eq Txt instance Show Txt where show = genericShow + instance TypelevelMIME Txt where fromValue MIME.Txt = Just Txt fromValue _ = Nothing value = MIME.Txt - + data Vsd = Vsd + derive instance Generic Vsd _ derive instance Eq Vsd instance Show Vsd where show = genericShow + instance TypelevelMIME Vsd where fromValue MIME.Vsd = Just Vsd fromValue _ = Nothing value = MIME.Vsd - + data Wav = Wav + derive instance Generic Wav _ derive instance Eq Wav instance Show Wav where show = genericShow + instance TypelevelMIME Wav where fromValue MIME.Wav = Just Wav fromValue _ = Nothing value = MIME.Wav - + data Weba = Weba + derive instance Generic Weba _ derive instance Eq Weba instance Show Weba where show = genericShow + instance TypelevelMIME Weba where fromValue MIME.Weba = Just Weba fromValue _ = Nothing value = MIME.Weba - + data Webm = Webm + derive instance Generic Webm _ derive instance Eq Webm instance Show Webm where show = genericShow + instance TypelevelMIME Webm where fromValue MIME.Webm = Just Webm fromValue _ = Nothing value = MIME.Webm - + data Webp = Webp + derive instance Generic Webp _ derive instance Eq Webp instance Show Webp where show = genericShow + instance TypelevelMIME Webp where fromValue MIME.Webp = Just Webp fromValue _ = Nothing value = MIME.Webp - + data Woff = Woff + derive instance Generic Woff _ derive instance Eq Woff instance Show Woff where show = genericShow + instance TypelevelMIME Woff where fromValue MIME.Woff = Just Woff fromValue _ = Nothing value = MIME.Woff - + data Woff2 = Woff2 + derive instance Generic Woff2 _ derive instance Eq Woff2 instance Show Woff2 where show = genericShow + instance TypelevelMIME Woff2 where fromValue MIME.Woff2 = Just Woff2 fromValue _ = Nothing value = MIME.Woff2 - + data Xhtml = Xhtml + derive instance Generic Xhtml _ derive instance Eq Xhtml instance Show Xhtml where show = genericShow + instance TypelevelMIME Xhtml where fromValue MIME.Xhtml = Just Xhtml fromValue _ = Nothing value = MIME.Xhtml - + data Xls = Xls + derive instance Generic Xls _ derive instance Eq Xls instance Show Xls where show = genericShow + instance TypelevelMIME Xls where fromValue MIME.Xls = Just Xls fromValue _ = Nothing value = MIME.Xls - + data Xlsx = Xlsx + derive instance Generic Xlsx _ derive instance Eq Xlsx instance Show Xlsx where show = genericShow + instance TypelevelMIME Xlsx where fromValue MIME.Xlsx = Just Xlsx fromValue _ = Nothing value = MIME.Xlsx - + data Xml = Xml + derive instance Generic Xml _ derive instance Eq Xml instance Show Xml where show = genericShow + instance TypelevelMIME Xml where fromValue MIME.Xml = Just Xml fromValue _ = Nothing value = MIME.Xml - + data Xul = Xul + derive instance Generic Xul _ derive instance Eq Xul instance Show Xul where show = genericShow + instance TypelevelMIME Xul where fromValue MIME.Xul = Just Xul fromValue _ = Nothing value = MIME.Xul - + data Zip = Zip + derive instance Generic Zip _ derive instance Eq Zip instance Show Zip where show = genericShow + instance TypelevelMIME Zip where fromValue MIME.Zip = Just Zip fromValue _ = Nothing value = MIME.Zip - + data Video3gp = Video3gp + derive instance Generic Video3gp _ derive instance Eq Video3gp instance Show Video3gp where show = genericShow + instance TypelevelMIME Video3gp where fromValue MIME.Video3gp = Just Video3gp fromValue _ = Nothing value = MIME.Video3gp - + data Video3g2 = Video3g2 + derive instance Generic Video3g2 _ derive instance Eq Video3g2 instance Show Video3g2 where show = genericShow + instance TypelevelMIME Video3g2 where fromValue MIME.Video3g2 = Just Video3g2 fromValue _ = Nothing value = MIME.Video3g2 - + data Archive7z = Archive7z + derive instance Generic Archive7z _ derive instance Eq Archive7z instance Show Archive7z where show = genericShow + instance TypelevelMIME Archive7z where fromValue MIME.Archive7z = Just Archive7z fromValue _ = Nothing diff --git a/test/Test/Axon.Header.Typed.purs b/test/Test/Axon.Header.Typed.purs index bb3982d..708a3b2 100644 --- a/test/Test/Axon.Header.Typed.purs +++ b/test/Test/Axon.Header.Typed.purs @@ -2,7 +2,43 @@ module Test.Axon.Header.Typed where import Prelude -import Axon.Header.Typed (class TypedHeader, Accept(..), AccessControlAllowCredentials(..), AccessControlAllowHeaders(..), AccessControlAllowMethods(..), AccessControlAllowOrigin(..), AccessControlExposeHeaders(..), AccessControlMaxAge(..), AccessControlRequestHeaders(..), AccessControlRequestMethod(..), Age(..), Allow(..), AuthScheme(..), Authorization(..), BasicAuth(..), BearerAuth(..), ByteRangeEnd(..), ByteRangeLength(..), ByteRangeStart(..), CacheControl(..), Connection(..), ConnectionClose(..), ContentDisposition(..), ContentDispositionAttachment(..), ContentDispositionFormData(..), ContentDispositionInline(..), ContentEncoding(..), ContentLength(..), ContentLocation(..), ContentRange(..), ContentType(..), Cookie(..), Wildcard(..), cacheControlDefaults, headerValueParser) +import Axon.Header.Typed + ( class TypedHeader + , Accept(..) + , AccessControlAllowCredentials(..) + , AccessControlAllowHeaders(..) + , AccessControlAllowMethods(..) + , AccessControlAllowOrigin(..) + , AccessControlExposeHeaders(..) + , AccessControlMaxAge(..) + , AccessControlRequestHeaders(..) + , AccessControlRequestMethod(..) + , Age(..) + , Allow(..) + , AuthScheme(..) + , Authorization(..) + , BasicAuth(..) + , BearerAuth(..) + , ByteRangeEnd(..) + , ByteRangeLength(..) + , ByteRangeStart(..) + , CacheControl(..) + , Connection(..) + , ConnectionClose(..) + , ContentDisposition(..) + , ContentDispositionAttachment(..) + , ContentDispositionFormData(..) + , ContentDispositionInline(..) + , ContentEncoding(..) + , ContentLength(..) + , ContentLocation(..) + , ContentRange(..) + , ContentType(..) + , Cookie(..) + , Wildcard(..) + , cacheControlDefaults + , headerValueParser + ) import Axon.Request.Method (Method(..)) import Control.Monad.Error.Class (liftEither) import Data.Bifunctor (lmap) @@ -20,7 +56,8 @@ import Type.MIME as Type.MIME is :: forall h. Eq h => Show h => TypedHeader h => String -> h -> Spec Unit is i exp = it ("parses " <> show i) do - act <- runParser i (headerValueParser @h) # lmap (error <<< parseErrorMessage) # liftEither + act <- runParser i (headerValueParser @h) # lmap (error <<< parseErrorMessage) + # liftEither act `shouldEqual` exp isnt :: forall h. Eq h => Show h => TypedHeader h => String -> h -> Spec Unit @@ -38,7 +75,8 @@ spec = describe "Accept MIME.MIME" do "application/json" `is` (Accept MIME.Json) "text/plain" `is` (Accept MIME.Txt) - "text/plain;charset=utf8" `is` (Accept $ MIME.Other "text/plain;charset=utf8") + "text/plain;charset=utf8" `is` + (Accept $ MIME.Other "text/plain;charset=utf8") "foo" `is` (Accept $ MIME.Other "foo") describe "Accept Aac" do "unknown" `isnt` Accept Type.MIME.Aac @@ -87,7 +125,8 @@ spec = "application/msword" `is` Accept Type.MIME.Doc describe "Accept Docx" do "unknown" `isnt` Accept Type.MIME.Docx - "application/vnd.openxmlformats-officedocument.wordprocessingml.document" `is` Accept Type.MIME.Docx + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" + `is` Accept Type.MIME.Docx describe "Accept Eot" do "unknown" `isnt` Accept Type.MIME.Eot "application/vnd.ms-fontobject" `is` Accept Type.MIME.Eot @@ -141,7 +180,8 @@ spec = "application/vnd.apple.installer+xml" `is` Accept Type.MIME.Mpkg describe "Accept Odp" do "unknown" `isnt` Accept Type.MIME.Odp - "application/vnd.oasis.opendocument.presentation" `is` Accept Type.MIME.Odp + "application/vnd.oasis.opendocument.presentation" `is` Accept + Type.MIME.Odp describe "Accept Ods" do "unknown" `isnt` Accept Type.MIME.Ods "application/vnd.oasis.opendocument.spreadsheet" `is` Accept Type.MIME.Ods @@ -177,7 +217,8 @@ spec = "application/vnd.ms-powerpoint" `is` Accept Type.MIME.Ppt describe "Accept Pptx" do "unknown" `isnt` Accept Type.MIME.Pptx - "application/vnd.openxmlformats-officedocument.presentationml.presentation" `is` Accept Type.MIME.Pptx + "application/vnd.openxmlformats-officedocument.presentationml.presentation" + `is` Accept Type.MIME.Pptx describe "Accept Rar" do "unknown" `isnt` Accept Type.MIME.Rar "application/vnd.rar" `is` Accept Type.MIME.Rar @@ -234,7 +275,8 @@ spec = "application/vnd.ms-excel" `is` Accept Type.MIME.Xls describe "Accept Xlsx" do "unknown" `isnt` Accept Type.MIME.Xlsx - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" `is` Accept Type.MIME.Xlsx + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" `is` + Accept Type.MIME.Xlsx describe "Accept Xml" do "unknown" `isnt` Accept Type.MIME.Xml "application/xml" `is` Accept Type.MIME.Xml @@ -259,7 +301,8 @@ spec = describe "ContentType MIME.MIME" do "application/json" `is` (ContentType MIME.Json) "text/plain" `is` (ContentType MIME.Txt) - "text/plain;charset=utf8" `is` (ContentType $ MIME.Other "text/plain;charset=utf8") + "text/plain;charset=utf8" `is` + (ContentType $ MIME.Other "text/plain;charset=utf8") "foo" `is` (ContentType $ MIME.Other "foo") describe "ContentType Aac" do "unknown" `isnt` ContentType Type.MIME.Aac @@ -308,7 +351,8 @@ spec = "application/msword" `is` ContentType Type.MIME.Doc describe "ContentType Docx" do "unknown" `isnt` ContentType Type.MIME.Docx - "application/vnd.openxmlformats-officedocument.wordprocessingml.document" `is` ContentType Type.MIME.Docx + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" + `is` ContentType Type.MIME.Docx describe "ContentType Eot" do "unknown" `isnt` ContentType Type.MIME.Eot "application/vnd.ms-fontobject" `is` ContentType Type.MIME.Eot @@ -362,10 +406,12 @@ spec = "application/vnd.apple.installer+xml" `is` ContentType Type.MIME.Mpkg describe "ContentType Odp" do "unknown" `isnt` ContentType Type.MIME.Odp - "application/vnd.oasis.opendocument.presentation" `is` ContentType Type.MIME.Odp + "application/vnd.oasis.opendocument.presentation" `is` ContentType + Type.MIME.Odp describe "ContentType Ods" do "unknown" `isnt` ContentType Type.MIME.Ods - "application/vnd.oasis.opendocument.spreadsheet" `is` ContentType Type.MIME.Ods + "application/vnd.oasis.opendocument.spreadsheet" `is` ContentType + Type.MIME.Ods describe "ContentType Odt" do "unknown" `isnt` ContentType Type.MIME.Odt "application/vnd.oasis.opendocument.text" `is` ContentType Type.MIME.Odt @@ -398,7 +444,8 @@ spec = "application/vnd.ms-powerpoint" `is` ContentType Type.MIME.Ppt describe "ContentType Pptx" do "unknown" `isnt` ContentType Type.MIME.Pptx - "application/vnd.openxmlformats-officedocument.presentationml.presentation" `is` ContentType Type.MIME.Pptx + "application/vnd.openxmlformats-officedocument.presentationml.presentation" + `is` ContentType Type.MIME.Pptx describe "ContentType Rar" do "unknown" `isnt` ContentType Type.MIME.Rar "application/vnd.rar" `is` ContentType Type.MIME.Rar @@ -455,7 +502,8 @@ spec = "application/vnd.ms-excel" `is` ContentType Type.MIME.Xls describe "ContentType Xlsx" do "unknown" `isnt` ContentType Type.MIME.Xlsx - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" `is` ContentType Type.MIME.Xlsx + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" `is` + ContentType Type.MIME.Xlsx describe "ContentType Xml" do "unknown" `isnt` ContentType Type.MIME.Xml "application/xml" `is` ContentType Type.MIME.Xml @@ -482,43 +530,65 @@ spec = "*" `is` AccessControlAllowHeaders (Left Wildcard) " * " `is` AccessControlAllowHeaders (Left Wildcard) "* " `is` AccessControlAllowHeaders (Left Wildcard) - "Vary" `is` AccessControlAllowHeaders (Right $ pure $ String.Lower.fromString "Vary") - " Vary" `isnt` AccessControlAllowHeaders (Right $ pure $ String.Lower.fromString "Vary") - "Vary " `isnt` AccessControlAllowHeaders (Right $ pure $ String.Lower.fromString "Vary") - "Vary, " `is` AccessControlAllowHeaders (Right $ pure $ String.Lower.fromString "Vary") - "Accept, Vary, Content-Type" `is` AccessControlAllowHeaders (Right $ (pure "Accept" <> pure "Vary" <> pure "Content-Type") <#> String.Lower.fromString) + "Vary" `is` AccessControlAllowHeaders + (Right $ pure $ String.Lower.fromString "Vary") + " Vary" `isnt` AccessControlAllowHeaders + (Right $ pure $ String.Lower.fromString "Vary") + "Vary " `isnt` AccessControlAllowHeaders + (Right $ pure $ String.Lower.fromString "Vary") + "Vary, " `is` AccessControlAllowHeaders + (Right $ pure $ String.Lower.fromString "Vary") + "Accept, Vary, Content-Type" `is` AccessControlAllowHeaders + ( Right $ (pure "Accept" <> pure "Vary" <> pure "Content-Type") <#> + String.Lower.fromString + ) describe "AccessControlAllowMethods" do "*" `is` AccessControlAllowMethods (Left Wildcard) " * " `is` AccessControlAllowMethods (Left Wildcard) "* " `is` AccessControlAllowMethods (Left Wildcard) "GET" `is` AccessControlAllowMethods (Right $ pure GET) "get" `isnt` AccessControlAllowMethods (Right $ pure GET) - "GET,,,,,, PATCH" `is` AccessControlAllowMethods (Right $ pure GET <> pure PATCH) - " GET , PATCH " `isnt` AccessControlAllowMethods (Right $ pure GET <> pure PATCH) + "GET,,,,,, PATCH" `is` AccessControlAllowMethods + (Right $ pure GET <> pure PATCH) + " GET , PATCH " `isnt` AccessControlAllowMethods + (Right $ pure GET <> pure PATCH) describe "AccessControlAllowOrigin" do "*" `is` AccessControlAllowOrigin (Left Wildcard) " * " `is` AccessControlAllowOrigin (Left Wildcard) "* " `is` AccessControlAllowOrigin (Left Wildcard) "foo" `is` AccessControlAllowOrigin (Right "foo") " foo " `is` AccessControlAllowOrigin (Right "foo") - "https://example.com" `is` AccessControlAllowOrigin (Right "https://example.com") + "https://example.com" `is` AccessControlAllowOrigin + (Right "https://example.com") describe "AccessControlExposeHeaders" do "*" `is` AccessControlExposeHeaders (Left Wildcard) " * " `is` AccessControlExposeHeaders (Left Wildcard) "* " `is` AccessControlExposeHeaders (Left Wildcard) - "Vary" `is` AccessControlExposeHeaders (Right $ pure $ String.Lower.fromString "Vary") - "Vary" `is` AccessControlExposeHeaders (Right $ pure $ String.Lower.fromString "Vary") - "Vary " `is` AccessControlExposeHeaders (Right $ pure $ String.Lower.fromString "Vary") - "Accept, Vary, Content-Type" `is` AccessControlExposeHeaders (Right $ (pure "Accept" <> pure "Vary" <> pure "Content-Type") <#> String.Lower.fromString) + "Vary" `is` AccessControlExposeHeaders + (Right $ pure $ String.Lower.fromString "Vary") + "Vary" `is` AccessControlExposeHeaders + (Right $ pure $ String.Lower.fromString "Vary") + "Vary " `is` AccessControlExposeHeaders + (Right $ pure $ String.Lower.fromString "Vary") + "Accept, Vary, Content-Type" `is` AccessControlExposeHeaders + ( Right $ (pure "Accept" <> pure "Vary" <> pure "Content-Type") <#> + String.Lower.fromString + ) describe "AccessControlMaxAge" do " 123 " `is` AccessControlMaxAge 123 " 0" `is` AccessControlMaxAge 0 "23190" `is` AccessControlMaxAge 23190 describe "AccessControlRequestHeaders" do - "Vary" `is` AccessControlRequestHeaders (pure $ String.Lower.fromString "Vary") - " Vary" `is` AccessControlRequestHeaders (pure $ String.Lower.fromString "Vary") - " Vary " `is` AccessControlRequestHeaders (pure $ String.Lower.fromString "Vary") - "Accept, Vary, Content-Type" `is` AccessControlRequestHeaders ((pure "Accept" <> pure "Vary" <> pure "Content-Type") <#> String.Lower.fromString) + "Vary" `is` AccessControlRequestHeaders + (pure $ String.Lower.fromString "Vary") + " Vary" `is` AccessControlRequestHeaders + (pure $ String.Lower.fromString "Vary") + " Vary " `is` AccessControlRequestHeaders + (pure $ String.Lower.fromString "Vary") + "Accept, Vary, Content-Type" `is` AccessControlRequestHeaders + ( (pure "Accept" <> pure "Vary" <> pure "Content-Type") <#> + String.Lower.fromString + ) describe "AccessControlRequestMethod" do "GET" `is` AccessControlRequestMethod GET " PATCH " `isnt` AccessControlRequestMethod PATCH @@ -542,21 +612,43 @@ spec = " Bing bar " `isnt` Authorization (AuthScheme "Bing") "bar" "Bar" `is` Authorization (AuthScheme "Bar") "" describe "BasicAuth" do - "Basic ZGVtbzpwQDU1dzByZA==" `is` BasicAuth {username: "demo", password: "p@55w0rd"} - "Bearer ZGVtbzpwQDU1dzByZA==" `isnt` BasicAuth {username: "demo", password: "p@55w0rd"} - "Basic foo" `isnt` BasicAuth {username: "demo", password: "p@55w0rd"} + "Basic ZGVtbzpwQDU1dzByZA==" `is` BasicAuth + { username: "demo", password: "p@55w0rd" } + "Bearer ZGVtbzpwQDU1dzByZA==" `isnt` BasicAuth + { username: "demo", password: "p@55w0rd" } + "Basic foo" `isnt` BasicAuth { username: "demo", password: "p@55w0rd" } describe "BearerAuth" do "Bearer foo" `is` BearerAuth "foo" "Basic foo" `isnt` BearerAuth "foo" "Bearer foo " `is` BearerAuth "foo" describe "CacheControl" do - "max-age=604800" `is` CacheControl (cacheControlDefaults {maxAge = Just 604800}) - " max-age=604800" `isnt` CacheControl (cacheControlDefaults {maxAge = Just 604800}) - "max-age=604800 " `isnt` CacheControl (cacheControlDefaults {maxAge = Just 604800}) - "max-age=604800, must-revalidate" `is` CacheControl (cacheControlDefaults {maxAge = Just 604800, mustRevalidate = true}) + "max-age=604800" `is` CacheControl + (cacheControlDefaults { maxAge = Just 604800 }) + " max-age=604800" `isnt` CacheControl + (cacheControlDefaults { maxAge = Just 604800 }) + "max-age=604800 " `isnt` CacheControl + (cacheControlDefaults { maxAge = Just 604800 }) + "max-age=604800, must-revalidate" `is` CacheControl + (cacheControlDefaults { maxAge = Just 604800, mustRevalidate = true }) "max-age=20, s-maxage=10, no-cache, must-revalidate, proxy-revalidate, no-store, private, public, must-understand, no-transform, immutable, stale-while-revalidate, stale-if-error" `is` - CacheControl (cacheControlDefaults {maxAge = Just 20, sMaxAge = Just 10, noCache = true, mustRevalidate = true, proxyRevalidate = true, noStore = true, private = true, public = true, mustUnderstand = true, noTransform = true, immutable = true, staleWhileRevalidate = true, staleIfError = true}) + CacheControl + ( cacheControlDefaults + { maxAge = Just 20 + , sMaxAge = Just 10 + , noCache = true + , mustRevalidate = true + , proxyRevalidate = true + , noStore = true + , private = true + , public = true + , mustUnderstand = true + , noTransform = true + , immutable = true + , staleWhileRevalidate = true + , staleIfError = true + } + ) "" `is` CacheControl cacheControlDefaults " " `isnt` CacheControl cacheControlDefaults "foo=bar" `is` CacheControl cacheControlDefaults @@ -569,25 +661,53 @@ spec = "close" `is` Connection (Left ConnectionClose) " close " `is` Connection (Left ConnectionClose) " cLoSe " `is` Connection (Left ConnectionClose) - "fuaiowf" `is` Connection (Right $ pure $ String.Lower.fromString "fuaiowf") - " a , b , c,d" `is` Connection (Right $ String.Lower.fromString <$> (pure "a" <> pure "b" <> pure "c" <> pure "d")) + "fuaiowf" `is` Connection + (Right $ pure $ String.Lower.fromString "fuaiowf") + " a , b , c,d" `is` Connection + ( Right $ String.Lower.fromString <$> + (pure "a" <> pure "b" <> pure "c" <> pure "d") + ) describe "ContentDisposition" do - "form-data" `is` ContentDisposition (Either.Nested.in3 $ ContentDispositionFormData {filename: Nothing, name: Nothing}) - "form-data; name=\"foo\"" `is` ContentDisposition (Either.Nested.in3 $ ContentDispositionFormData {filename: Nothing, name: Just "foo"}) - "form-data; filename=\"foo.txt\"" `is` ContentDisposition (Either.Nested.in3 $ ContentDispositionFormData {filename: Just "foo.txt", name: Nothing}) - " form-data; filename=\"foo.txt\" ; name=\"foo\" " `isnt` ContentDisposition (Either.Nested.in3 $ ContentDispositionFormData {filename: Just "foo.txt", name: Just "foo"}) + "form-data" `is` ContentDisposition + ( Either.Nested.in3 $ ContentDispositionFormData + { filename: Nothing, name: Nothing } + ) + "form-data; name=\"foo\"" `is` ContentDisposition + ( Either.Nested.in3 $ ContentDispositionFormData + { filename: Nothing, name: Just "foo" } + ) + "form-data; filename=\"foo.txt\"" `is` ContentDisposition + ( Either.Nested.in3 $ ContentDispositionFormData + { filename: Just "foo.txt", name: Nothing } + ) + " form-data; filename=\"foo.txt\" ; name=\"foo\" " `isnt` + ContentDisposition + ( Either.Nested.in3 $ ContentDispositionFormData + { filename: Just "foo.txt", name: Just "foo" } + ) - "attachment" `is` ContentDisposition (Either.Nested.in2 $ ContentDispositionAttachment {filename: Nothing}) - "attachment; filename=\"foo.txt\"" `is` ContentDisposition (Either.Nested.in2 $ ContentDispositionAttachment {filename: Just "foo.txt"}) - " attachment; filename=\"foo.txt\" " `isnt` ContentDisposition (Either.Nested.in2 $ ContentDispositionAttachment {filename: Just "foo.txt"}) + "attachment" `is` ContentDisposition + (Either.Nested.in2 $ ContentDispositionAttachment { filename: Nothing }) + "attachment; filename=\"foo.txt\"" `is` ContentDisposition + ( Either.Nested.in2 $ ContentDispositionAttachment + { filename: Just "foo.txt" } + ) + " attachment; filename=\"foo.txt\" " `isnt` ContentDisposition + ( Either.Nested.in2 $ ContentDispositionAttachment + { filename: Just "foo.txt" } + ) - "inline" `is` ContentDisposition (Either.Nested.in1 $ ContentDispositionInline) - "inline " `is` ContentDisposition (Either.Nested.in1 $ ContentDispositionInline) - " inline " `is` ContentDisposition (Either.Nested.in1 $ ContentDispositionInline) + "inline" `is` ContentDisposition + (Either.Nested.in1 $ ContentDispositionInline) + "inline " `is` ContentDisposition + (Either.Nested.in1 $ ContentDispositionInline) + " inline " `is` ContentDisposition + (Either.Nested.in1 $ ContentDispositionInline) describe "ContentEncoding" do "gzip" `is` ContentEncoding (pure "gzip") " gzip " `is` ContentEncoding (pure "gzip") - " gzip , deflate " `is` ContentEncoding (pure "gzip" <> pure "deflate") + " gzip , deflate " `is` ContentEncoding + (pure "gzip" <> pure "deflate") describe "ContentLength" do " 0 " `is` ContentLength 0 " 1 " `is` ContentLength 1 @@ -598,18 +718,31 @@ spec = " a " `is` ContentLocation "a" "abc" `is` ContentLocation "abc" describe "ContentRange" do - "bytes 0-10/10" `is` (ContentRange $ Either.Nested.in1 $ ByteRangeStart 0 /\ ByteRangeEnd 10 /\ ByteRangeLength 10) - " bytes 0-10/10 " `is` (ContentRange $ Either.Nested.in1 $ ByteRangeStart 0 /\ ByteRangeEnd 10 /\ ByteRangeLength 10) - " bytes 0-0/0 " `is` (ContentRange $ Either.Nested.in1 $ ByteRangeStart 0 /\ ByteRangeEnd 0 /\ ByteRangeLength 0) - "bytes 0-10/*" `is` (ContentRange $ Either.Nested.in2 $ ByteRangeStart 0 /\ ByteRangeEnd 10) - " bytes 0-10/* " `is` (ContentRange $ Either.Nested.in2 $ ByteRangeStart 0 /\ ByteRangeEnd 10) + "bytes 0-10/10" `is` + ( ContentRange $ Either.Nested.in1 $ ByteRangeStart 0 /\ ByteRangeEnd 10 + /\ ByteRangeLength 10 + ) + " bytes 0-10/10 " `is` + ( ContentRange $ Either.Nested.in1 $ ByteRangeStart 0 /\ ByteRangeEnd 10 + /\ ByteRangeLength 10 + ) + " bytes 0-0/0 " `is` + ( ContentRange $ Either.Nested.in1 $ ByteRangeStart 0 /\ ByteRangeEnd 0 + /\ ByteRangeLength 0 + ) + "bytes 0-10/*" `is` + (ContentRange $ Either.Nested.in2 $ ByteRangeStart 0 /\ ByteRangeEnd 10) + " bytes 0-10/* " `is` + (ContentRange $ Either.Nested.in2 $ ByteRangeStart 0 /\ ByteRangeEnd 10) "bytes */10" `is` (ContentRange $ Either.Nested.in3 $ ByteRangeLength 10) - " bytes */10 " `is` (ContentRange $ Either.Nested.in3 $ ByteRangeLength 10) + " bytes */10 " `is` + (ContentRange $ Either.Nested.in3 $ ByteRangeLength 10) describe "Cookie" do "foo=" `is` Cookie (pure ("foo" /\ "")) "foo=bar" `is` Cookie (pure ("foo" /\ "bar")) "foo=bar; baz=" `is` Cookie (pure ("foo" /\ "bar") <> pure ("baz" /\ "")) - "foo=bar; baz=quux" `is` Cookie (pure ("foo" /\ "bar") <> pure ("baz" /\ "quux")) + "foo=bar; baz=quux" `is` Cookie + (pure ("foo" /\ "bar") <> pure ("baz" /\ "quux")) describe "Date" $ pure unit describe "ETag" $ pure unit describe "ExpectContinue" $ pure unit @@ -637,4 +770,4 @@ spec = describe "TransferEncoding" $ pure unit describe "Upgrade" $ pure unit describe "UserAgent" $ pure unit - describe "Vary"$ pure unit + describe "Vary" $ pure unit diff --git a/test/Test/Axon.Request.Handler.purs b/test/Test/Axon.Request.Handler.purs new file mode 100644 index 0000000..5e277b9 --- /dev/null +++ b/test/Test/Axon.Request.Handler.purs @@ -0,0 +1,74 @@ +module Test.Axon.Request.Handler where + +import Axon.Request.Parts.Class +import Prelude + +import Axon.Request (Body) +import Axon.Request as Request +import Axon.Request.Handler as Handle +import Axon.Request.Handler.Default (notFound) +import Axon.Request.Method (Method(..)) +import Axon.Request.Parts.Path (type (/)) +import Axon.Response (Response) +import Axon.Response as Response +import Axon.Response.Body as Response.Body +import Control.Monad.Error.Class (liftEither) +import Data.Bifunctor (lmap) +import Data.Either (Either(..)) +import Data.Map (Map) +import Data.Map as Map +import Data.Maybe (fromJust) +import Data.URL (URL) +import Data.URL as URL +import Effect.Aff (Aff, error) +import Effect.Class (liftEffect) +import Effect.Unsafe (unsafePerformEffect) +import Node.Net.SocketAddress as SocketAddress +import Node.Net.Types (IPv4, IPv6, SocketAddress) +import Partial.Unsafe (unsafePartial) +import Test.Spec (Spec, describe, it) +import Test.Spec.Assertions (shouldEqual) + +defaultRequest :: + { headers :: Map String String + , address :: Either (SocketAddress IPv4) (SocketAddress IPv6) + , url :: URL + , method :: Method + , body :: Body + } +defaultRequest = + { body: Request.BodyEmpty + , url: URL.fromString "http://localhost:80/" # unsafePartial fromJust + , headers: Map.singleton "content-type" "application/json" + , address: Left $ unsafePerformEffect $ SocketAddress.newIpv4 + { address: "127.0.0.1", port: 81 } + , method: GET + } + +getPerson :: Get -> Path ("people" / Int) Int -> Aff Response +getPerson _ (Path id) = + if id == 1 then + pure $ Response.response 200 + (Response.Body.stringBody "{\"name\": \"Henry\"}") + Map.empty + else + pure $ Response.fromStatus 404 + +spec :: Spec Unit +spec = describe "Handler" do + it "responds ok" do + req <- liftEffect $ Request.make $ defaultRequest + { url = defaultRequest.url `URL.(/)` "people" `URL.(/)` "1" } + rep <- Handle.invokeHandler (getPerson `Handle.or` notFound) req + <#> lmap (error <<< show) + >>= liftEither + Response.status rep `shouldEqual` 200 + it "responds not found" do + req <- liftEffect $ Request.make $ defaultRequest + { url = defaultRequest.url `URL.(/)` "people" `URL.(/)` "1" + , method = PUT + } + rep <- Handle.invokeHandler (getPerson `Handle.or` notFound) req + <#> lmap (error <<< show) + >>= liftEither + Response.status rep `shouldEqual` 404 diff --git a/test/Test/Axon.Request.Parts.purs b/test/Test/Axon.Request.Parts.purs index ab18de9..0eb422a 100644 --- a/test/Test/Axon.Request.Parts.purs +++ b/test/Test/Axon.Request.Parts.purs @@ -5,8 +5,18 @@ import Prelude import Axon.Header.Typed (ContentType) import Axon.Request (Request) import Axon.Request as Request +import Axon.Request.Handler (invokeHandler) import Axon.Request.Method (Method(..)) -import Axon.Request.Parts.Class (ExtractError(..), Header, Json(..), Patch, Path(..), Post(..), extractRequestParts, invokeHandler) +import Axon.Request.Parts.Class + ( ExtractError(..) + , Header + , Json(..) + , Patch + , Path(..) + , Post(..) + , Try(..) + , extractRequestParts + ) import Axon.Request.Parts.Path (type (/), IgnoreRest) import Control.Monad.Error.Class (liftEither) import Data.Bifunctor (lmap) @@ -39,7 +49,8 @@ spec = describe "Parts" do { address: "127.0.0.1", port: 81 } , method: GET } - _ :: Request <- invokeHandler req (pure @Aff) <#> lmap (error <<< show) >>= liftEither + _ :: Request <- invokeHandler (pure @Aff) req <#> lmap (error <<< show) >>= + liftEither pure unit it "extracts header, method, path, JSON body" do @@ -63,12 +74,12 @@ spec = describe "Parts" do Path ("users" / Int) Int -> Json { firstName :: String } -> Aff String - handler _ _ (Path id) (Json {firstName}) = do + handler _ _ (Path id) (Json { firstName }) = do id `shouldEqual` 12 firstName `shouldEqual` "henry" pure firstName - name <- invokeHandler req handler + name <- invokeHandler handler req <#> lmap (error <<< show) >>= liftEither @@ -171,10 +182,10 @@ spec = describe "Parts" do { address: "127.0.0.1", port: 81 } , method: GET } - a <- extractRequestParts @(Either Request.BodyStringError String) req + a <- extractRequestParts @(Try Request.BodyStringError String) req <#> lmap (error <<< show) >>= liftEither - a `shouldEqual` (Right "foo") + a `shouldEqual` (Ok "foo") it "extracts a string body from a readable stream" do stream <- Buffer.fromString "foo" UTF8 >>= Stream.readableFromBuffer # @@ -187,10 +198,10 @@ spec = describe "Parts" do { address: "127.0.0.1", port: 81 } , method: GET } - a <- extractRequestParts @(Either Request.BodyStringError String) req + a <- extractRequestParts @(Try Request.BodyStringError String) req <#> lmap (error <<< show) >>= liftEither - a `shouldEqual` (Right "foo") + a `shouldEqual` (Ok "foo") a' <- extractRequestParts @String req <#> lmap (error <<< show) >>= liftEither @@ -206,10 +217,10 @@ spec = describe "Parts" do { address: "127.0.0.1", port: 81 } , method: GET } - a <- extractRequestParts @(Either Request.BodyStringError String) req + a <- extractRequestParts @(Try Request.BodyStringError String) req <#> lmap (error <<< show) >>= liftEither - a `shouldEqual` (Right "foo") + a `shouldEqual` (Ok "foo") a' <- extractRequestParts @String req <#> lmap (error <<< show) >>= liftEither diff --git a/test/Test/Axon.Request.purs b/test/Test/Axon.Request.purs index e76d77a..2198f95 100644 --- a/test/Test/Axon.Request.purs +++ b/test/Test/Axon.Request.purs @@ -3,8 +3,10 @@ module Test.Axon.Request where import Prelude import Test.Axon.Request.Parts as Parts +import Test.Axon.Request.Handler as Handler import Test.Spec (Spec, describe) spec :: Spec Unit spec = describe "Request" do Parts.spec + Handler.spec