remote-curl: tighten "version 2" check for smart-http
authorJeff King <redacted>
Wed, 6 Feb 2019 19:18:58 +0000 (14:18 -0500)
committerJunio C Hamano <redacted>
Wed, 6 Feb 2019 20:20:22 +0000 (12:20 -0800)
commitcbdb8d14392690f2e540b9efdb245871a043eb06
tree609be1ffc8bd2f7c08727ec9ed8767fec909f7c5
parent8ee3e120cd167dcfd2b7399cce567c724dfef134
remote-curl: tighten "version 2" check for smart-http

In a v2 smart-http conversation, the server should reply to our initial
request with a pkt-line saying "version 2". We check that with
starts_with(), but really that should be the only thing in that packet.
A response of "version 20" should not match.

Let's tighten this check to use strcmp(). Note that we don't need to
worry about a trailing newline here, because the ptk-line code will have
chomped it for us already.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
remote-curl.c
git clone https://git.99rst.org/PROJECT