cs531-f19 / discussions

Discussions board for CS 431/531 Web Server Design course
2 stars 12 forks source link

Duplicate response headers for pipelined response #79

Open kritikagarg opened 4 years ago

kritikagarg commented 4 years ago

While running test cases test_protected_options_trace_full_method_support and test_delete_verify in A5, an unexpected output is showing up. The 1st response of all the pipelined response is showing duplicate headers.

< HTTP/1.1 200 OK
< Date: Fri, 06 Dec 2019 06:54:45 GMT
< Server: kitkat.2.0
< Transfer-Encoding: chunked
< 
< HTTP/1.1 200 OK
< Date: Fri, 06 Dec 2019 06:54:45 GMT
< Server: kitkat.2.0
< Transfer-Encoding: chunked
< 
10
<html>
<body>

21
<h1>File deleted.</h1>
</body>
0

HTTP/1.1 404 Not Found
Date: Fri, 06 Dec 2019 06:54:45 GMT
Server: kitkat.2.0
Content-Type: text/html
Connection: close
Transfer-Encoding: chunked

17
<!DOCTYPE HTML>
<HTML>

25
<HEAD>
    <TITLE>404 Not Found</TITLE>

f
</HEAD>
<BODY>

22
    <H1>404</H1>
    <H2>Not Found</H2>

e
    ----
</BODY>

9
</HTML>

0

This pattern is showing in pipelined DELETE and OPTIONS requests. The problem does not occur on sending a request through netcat.

HTTP/1.1 200 OK
Date: Fri, 06 Dec 2019 07:59:48 GMT
Server: kitkat.2.0
Transfer-Encoding: chunked

10
<html>
<body>

21
<h1>File deleted.</h1>
</body>
0

HTTP/1.1 404 Not Found
Date: Fri, 06 Dec 2019 07:59:48 GMT
Server: kitkat.2.0
Content-Type: text/html
Connection: close
Transfer-Encoding: chunked

17
<!DOCTYPE HTML>
<HTML>

25
<HEAD>
    <TITLE>404 Not Found</TITLE>

f
</HEAD>
<BODY>

22
    <H1>404</H1>
    <H2>Not Found</H2>

e
    ----
</BODY>

9
</HTML>

0
himarshaj commented 4 years ago

Hello, I am facing the exact same issue. I was thinking that it is a problem with the pipe-lining at my end.

ibnesayeed commented 4 years ago

@kritikagarg your chunked encoding seems wrong in accurately treating new lines of the payload.