You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When it comes to transfer encodings idris-http lacks a lot of features. Chunked Encoding is a special case that needs special review. With chunked encoding we are bound to counting bytes. The String type doesn't have the ability to check a length in bytes. That is a huge problem.
Idea 1: ByteString
We could just start making a ByteString library to support it. We would have one large problem with it: We would need to get TCP libraries to use them. Then chunked encoding wouldn't be too much magic here.
Idea 2: Do awkward requests
We could start reqeusting single bytes over TCP and then finally when we get to chunked encoding we request the nujmber of bytes of the next chunk. This is an awful implementation that I wouldn't like to support.
Are there any other ways to go?
The text was updated successfully, but these errors were encountered:
Hi - I used idris-http for a bit of play and found chunked encoding is not working as expected, because the current hexParser might not return the correct number, Try the below if ever needed:
hexParser: Parser Int
hexParser =do { x <- hexParser'; pure $fst x } wherehexParser': Parser (Int, Int)
hexParser' =do
c <- hexDigit
hex2 <- opt $ hexParser'
let hex = ord $ toUpper c
let num =if hex >= ord '0'&& hex <= ord '9'then hex - ord '0'else10+ hex - ord 'A'case hex2 ofJust (x, pw) =>let pw' = pw +1;
mag =Prelude.pow 16$ cast {to=Nat} pw' in
pure (x + num * mag, pw')
Nothing=> pure (num, 0)
When it comes to transfer encodings idris-http lacks a lot of features. Chunked Encoding is a special case that needs special review. With chunked encoding we are bound to counting bytes. The String type doesn't have the ability to check a length in bytes. That is a huge problem.
Idea 1: ByteString
We could just start making a ByteString library to support it. We would have one large problem with it: We would need to get TCP libraries to use them. Then chunked encoding wouldn't be too much magic here.
Idea 2: Do awkward requests
We could start reqeusting single bytes over TCP and then finally when we get to chunked encoding we request the nujmber of bytes of the next chunk. This is an awful implementation that I wouldn't like to support.
Are there any other ways to go?
The text was updated successfully, but these errors were encountered: