mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-06-09 05:00:21 +00:00
Use supplied content_type even on zero-length requests.
This commit is contained in:
parent
44df9b9f32
commit
f0e60b8fb2
@ -182,11 +182,11 @@ class CalDAVRequest
|
||||
$_SERVER['REQUEST_METHOD'] = $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'];
|
||||
}
|
||||
$this->method = $_SERVER['REQUEST_METHOD'];
|
||||
$this->content_type = (isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null);
|
||||
if ( preg_match( '{^(\S+/\S+)\s*(;.*)?$}', $this->content_type, $matches ) ) {
|
||||
$this->content_type = $matches[1];
|
||||
}
|
||||
if ( isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > 7 ) {
|
||||
$this->content_type = (isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null);
|
||||
if ( preg_match( '{^(\S+/\S+)\s*(;.*)?$}', $this->content_type, $matches ) ) {
|
||||
$this->content_type = $matches[1];
|
||||
}
|
||||
if ( $this->method == 'PROPFIND' || $this->method == 'REPORT' ) {
|
||||
if ( !preg_match( '{^(text|application)/xml$}', $this->content_type ) ) {
|
||||
@dbg_error_log( "LOG request", 'Request is "%s" but client set content-type to "%s". Assuming they meant XML!',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user