mirror of
https://git.proxmox.com/git/pve-http-server
synced 2025-05-01 02:39:09 +00:00
proxy request: handle missing content-type header
In case the actual request-body is empty it seems not Content-Type
header is set by browsers.
Tested on a vm with stopping and starting a container via GUI
(/api2/extjs/nodes/<nodename>/lxc/<vmid>/status/stop)
fixes f398a3d94b
Reported-by: Friedrich Weber <f.weber@proxmox.com>
Reported-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
This commit is contained in:
parent
0e761983b9
commit
81f0f40ea1
@ -745,7 +745,8 @@ sub proxy_request {
|
||||
my $content;
|
||||
|
||||
if ($method eq 'POST' || $method eq 'PUT') {
|
||||
if ($reqstate->{request}->header('Content-Type') =~ 'application/json') {
|
||||
my $request_ct = $reqstate->{request}->header('Content-Type');
|
||||
if (defined($request_ct) && $request_ct =~ 'application/json') {
|
||||
$headers->{'Content-Type'} = 'application/json';
|
||||
$content = encode_json($params);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user