http: rename HttpdException to HTTPException

This commit is contained in:
Jeremy Baxter 2024-08-07 13:39:22 +12:00
parent caacad97dd
commit 37a7b67164
2 changed files with 10 additions and 9 deletions

12
httpd.d
View file

@ -5,17 +5,11 @@ import http;
import std.algorithm;
import std.array;
import std.conv;
import std.exception;
import std.format;
import std.socket;
import std.stdio;
import std.string;
class HttpdException : Exception
{
mixin basicExceptionCtors;
}
int
main(string[] args)
{
@ -65,7 +59,7 @@ tryRequest(char[] requestBody)
|| rq.resource == "/index.html"
? respondWithPage(import("index.html"))
: failurePage("404 Not Found");
} catch (HttpdException e)
} catch (HTTPException e)
return failurePage(e.msg);
}
@ -172,7 +166,7 @@ parseHTTPRequestHeading(string heading)
result.method = HTTPMethod.TRACE;
break;
default:
throw new HttpdException("400 Bad Request");
throw new HTTPException("400 Bad Request");
}
tup = heading.findSplit(" ");
@ -183,7 +177,7 @@ parseHTTPRequestHeading(string heading)
params = params.length == path.length ? "" : params;
if (path.length == 0 || path[0] != '/')
throw new HttpdException("400 Bad Request");
throw new HTTPException("400 Bad Request");
result.path = path;