mirror of https://github.com/adamdruppe/arsd.git
add requestContentType member
This commit is contained in:
parent
df008ed820
commit
d07483d544
17
cgi.d
17
cgi.d
|
@ -1151,6 +1151,7 @@ class Cgi {
|
||||||
this.pathInfo = pathInfo;
|
this.pathInfo = pathInfo;
|
||||||
this.queryString = queryString;
|
this.queryString = queryString;
|
||||||
this.postBody = null;
|
this.postBody = null;
|
||||||
|
this.requestContentType = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private {
|
private {
|
||||||
|
@ -1374,6 +1375,7 @@ class Cgi {
|
||||||
files = keepLastOf(filesArray);
|
files = keepLastOf(filesArray);
|
||||||
post = keepLastOf(postArray);
|
post = keepLastOf(postArray);
|
||||||
this.postBody = pps.postBody;
|
this.postBody = pps.postBody;
|
||||||
|
this.requestContentType = contentType;
|
||||||
cleanUpPostDataState();
|
cleanUpPostDataState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2201,6 +2203,8 @@ class Cgi {
|
||||||
files = keepLastOf(filesArray);
|
files = keepLastOf(filesArray);
|
||||||
post = keepLastOf(postArray);
|
post = keepLastOf(postArray);
|
||||||
postBody = pps.postBody;
|
postBody = pps.postBody;
|
||||||
|
this.requestContentType = contentType;
|
||||||
|
|
||||||
cleanUpPostDataState();
|
cleanUpPostDataState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2874,6 +2878,14 @@ class Cgi {
|
||||||
public immutable string postBody;
|
public immutable string postBody;
|
||||||
alias postJson = postBody; // old name
|
alias postJson = postBody; // old name
|
||||||
|
|
||||||
|
/++
|
||||||
|
The content type header of the request. The [postBody] member may hold the actual data (see [postBody] for details).
|
||||||
|
|
||||||
|
History:
|
||||||
|
Added January 26, 2024 (dub v11.4)
|
||||||
|
+/
|
||||||
|
public immutable string requestContentType;
|
||||||
|
|
||||||
/* Internal state flags */
|
/* Internal state flags */
|
||||||
private bool outputtedResponseData;
|
private bool outputtedResponseData;
|
||||||
private bool noCache = true;
|
private bool noCache = true;
|
||||||
|
@ -3687,6 +3699,11 @@ mixin template CustomCgiDispatcherMain(CustomCgi, size_t maxContentLength, Prese
|
||||||
activePresenter = presenter;
|
activePresenter = presenter;
|
||||||
scope(exit) activePresenter = null;
|
scope(exit) activePresenter = null;
|
||||||
|
|
||||||
|
if(cgi.pathInfo.length == 0) {
|
||||||
|
cgi.setResponseLocation(cgi.scriptName ~ "/");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(cgi.dispatcher!DispatcherArgs(presenter))
|
if(cgi.dispatcher!DispatcherArgs(presenter))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue