From 51ab9a97d02689e06df19559b1cc0a86bc9316c0 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Thu, 12 Feb 2015 10:52:16 +0100 Subject: [PATCH] only print WWW-Authenticate when there are data to print --- src/worker-auth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/worker-auth.c b/src/worker-auth.c index 0b457c02..140ab67f 100644 --- a/src/worker-auth.c +++ b/src/worker-auth.c @@ -889,7 +889,7 @@ int post_common_handler(worker_st * ws, unsigned http_ver, const char *imsg) if (ret < 0) return -1; - if (ws->selected_auth->type & AUTH_TYPE_GSSAPI && imsg != NULL) { + if (ws->selected_auth->type & AUTH_TYPE_GSSAPI && imsg != NULL && imsg[0] != 0) { ret = cstp_printf(ws, "WWW-Authenticate: Negotiate %s\r\n", imsg); if (ret < 0) return -1; @@ -1323,6 +1323,7 @@ int post_auth_handler(worker_st * ws, unsigned http_ver) goto auth_fail; } + msg[0] = 0; ret = recv_auth_reply(ws, sd, msg, sizeof(msg)); if (sd != -1) { close(sd);