diff --git a/cgi.d b/cgi.d index e8d4e00..d0b7d1f 100644 --- a/cgi.d +++ b/cgi.d @@ -150,7 +150,7 @@ void main() { ) Compile_and_run: - + For CGI, `dmd yourfile.d cgi.d` then put the executable in your cgi-bin directory. For FastCGI: `dmd yourfile.d cgi.d -version=fastcgi` and run it. spawn-fcgi helps on nginx. You can put the file in the directory for Apache. On IIS, run it with a port on the command line (this causes it to call FCGX_OpenSocket, which can work on nginx too). @@ -328,7 +328,7 @@ void main() { web applications. For working with json, try [arsd.jsvar]. - + [arsd.database], [arsd.mysql], [arsd.postgres], [arsd.mssql], and [arsd.sqlite] can help in accessing databases. @@ -532,7 +532,7 @@ class ConnectionClosedException : Exception { } } - + version(Windows) { // FIXME: ugly hack to solve stdin exception problems on Windows: // reading stdin results in StdioException (Bad file descriptor) @@ -1345,7 +1345,7 @@ class Cgi { } /* - stderr.writeln("RECEIVED: ", pps.piece.name, "=", + stderr.writeln("RECEIVED: ", pps.piece.name, "=", pps.piece.content.length < 1000 ? to!string(pps.piece.content) @@ -1612,7 +1612,7 @@ class Cgi { /// My idea here was so you can output a progress bar or /// something to a cooperative client (see arsd.rtud for a potential helper) /// - /// The default is to do nothing. Subclass cgi and use the + /// The default is to do nothing. Subclass cgi and use the /// CustomCgiMain mixin to do something here. void onRequestBodyDataReceived(size_t receivedSoFar, size_t totalExpected) const { // This space intentionally left blank. @@ -1964,8 +1964,8 @@ class Cgi { /// application. Either use Apache's built in methods for basic authentication, or add /// something along these lines to your server configuration: /// - /// RewriteEngine On - /// RewriteCond %{HTTP:Authorization} ^(.*) + /// RewriteEngine On + /// RewriteCond %{HTTP:Authorization} ^(.*) /// RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1] /// /// To ensure the necessary data is available to cgi.d. @@ -2420,7 +2420,7 @@ class Cgi { /++ Gets a request variable as a specific type, or the default value of it isn't there or isn't convertible to the request type. - + Checks both GET and POST variables, preferring the POST variable, if available. A nice trick is using the default value to choose the type: @@ -2555,7 +2555,7 @@ class Cgi { immutable(char[]) referrer; immutable(char[]) requestUri; /// The full url if the current request, excluding the protocol and host. requestUri == scriptName ~ pathInfo ~ (queryString.length ? "?" ~ queryString : ""); - immutable(char[]) remoteAddress; /// The IP address of the user, as we see it. (Might not match the IP of the user's computer due to things like proxies and NAT.) + immutable(char[]) remoteAddress; /// The IP address of the user, as we see it. (Might not match the IP of the user's computer due to things like proxies and NAT.) immutable bool https; /// Was the request encrypted via https? immutable int port; /// On what TCP port number did the server receive the request? @@ -2568,7 +2568,7 @@ class Cgi { /** Represents user uploaded files. - + When making a file upload form, be sure to follow the standard: set method="POST" and enctype="multipart/form-data" in your html