소스 검색

Merge pull request #567 from catnapgames/patch-1

Update civetweb.c
bel2125 7 년 전
부모
커밋
cf4f297af6
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      src/civetweb.c

+ 3 - 3
src/civetweb.c

@@ -4305,6 +4305,9 @@ mg_send_http_error_impl(struct mg_connection *conn,
 		return;
 	}
 
+	/* Errors 1xx, 204 and 304 MUST NOT send a body */
+	has_body = ((status > 199) && (status != 204) && (status != 304));
+
 	/* Prepare message in buf, if required */
 	if ((has_body && (fmt != NULL))
 	    || (!conn->in_error_handler
@@ -4410,9 +4413,6 @@ mg_send_http_error_impl(struct mg_connection *conn,
 		/* No custom error page. Send default error page. */
 		gmt_time_string(date, sizeof(date), &curtime);
 
-		/* Errors 1xx, 204 and 304 MUST NOT send a body */
-		has_body = ((status > 199) && (status != 204) && (status != 304));
-
 		conn->must_close = 1;
 		mg_printf(conn, "HTTP/1.1 %d %s\r\n", status, status_text);
 		send_no_cache_header(conn);