From 6bad235a59c65169246d8b4c62a6d447afba703f Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Mon, 11 Jan 2021 11:34:09 -0500 Subject: [PATCH] int overload --- cgi.d | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cgi.d b/cgi.d index e971501..7876617 100644 --- a/cgi.d +++ b/cgi.d @@ -2007,13 +2007,22 @@ class Cgi { return scriptName; } - /// Sets the HTTP status of the response. For example, "404 File Not Found" or "500 Internal Server Error". - /// It assumes "200 OK", and automatically changes to "302 Found" if you call setResponseLocation(). - /// Note setResponseStatus() must be called *before* you write() any data to the output. + /++ + Sets the HTTP status of the response. For example, "404 File Not Found" or "500 Internal Server Error". + It assumes "200 OK", and automatically changes to "302 Found" if you call setResponseLocation(). + Note setResponseStatus() must be called *before* you write() any data to the output. + + History: + The `int` overload was added on January 11, 2021. + +/ void setResponseStatus(string status) { assert(!outputtedResponseData); responseStatus = status; } + /// ditto + void setResponseStatus(int statusCode) { + setResponseStatus(getHttpCodeText(statusCode)); + } private string responseStatus = null; /// Returns true if it is still possible to output headers