For Download Routes, it's not returning the correctly formed output. Apparently, the fromStream method uses a binary encoder, and fromStreamChunked does not.
Expected output:
curl -i http://localhost:8080/download
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: attachment; filename=file.txt
transfer-encoding: chunked
line number 1
1, 2, 3, 4, 5
line number 3
end of file
user@host ~> curl -i localhost:8080/greet
HTTP/1.1 400 Bad Request
warning: 199 ZIO HTTP "The name query parameter is missing!"
date: Thu, 16 May 2024 13:19:17 GMT
content-length: 0
Issue 3:
Moreover, the logic for handling multiple names is also incorrect.
Expected Output
user@host ~> curl -i localhost:8080/greet
HTTP/1.1 200 OK
content-type: text/plain
content-length: 12
Hello Danish and Amjad!
Actual Output
user@host ~> curl -i "localhost:8080/greet?name=Danish&name=Amjad"
HTTP/1.1 200 OK
content-type: text/plain
date: Thu, 16 May 2024 13:23:24 GMT
content-length: 71
Hello Chunk(D and a and n and i and s and h,A and m and j and a and d)!
The zio-quickstart-restful-webservice does not work as expected as mentioned in the documentation. https://zio.dev/guides/quickstarts/restful-webservice/
Issue 1:
For Download Routes, it's not returning the correctly formed output. Apparently, the
fromStream
method uses a binary encoder, andfromStreamChunked
does not.Expected output:
Actual Output
Issue 2:
For Greetings Routes, the logic of the routes is not correct. The
/greet
route does not return the correct response.Expected Output
Actual Output
Issue 3:
Moreover, the logic for handling multiple names is also incorrect.
Expected Output
Actual Output