From: Tianjia Zhang Date: Wed, 8 Dec 2021 07:53:49 +0000 (+0800) Subject: apps/s_server: Correct s_server to return the correct file path X-Git-Tag: openssl-3.2.0-alpha1~3230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e3b82926a8cdae5a1bfbf3ac47a6012c270391b;p=thirdparty%2Fopenssl.git apps/s_server: Correct s_server to return the correct file path When s_server responds to a file data with the -WWW parameter, it always gets a path named "GET". In this case, we need to skip the "GET /" character to get the correct file path. Signed-off-by: Tianjia Zhang Reviewed-by: Paul Yang Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/17231) --- diff --git a/apps/s_server.c b/apps/s_server.c index 6b0e013ca78..e0a52287eec 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -3220,7 +3220,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context) } BIO_puts(io, "\r\n\r\n"); break; - } else if ((www == 2 || www == 3) && HAS_PREFIX(p, "GET /")) { + } else if ((www == 2 || www == 3) && CHECK_AND_SKIP_PREFIX(p, "GET /")) { BIO *file; char *e; static const char *text =