Skip to content

Commit fbda250

Browse files
authored
Merge pull request #538 from nextcloud/backport/537/stable31
[stable31] (fix): AppAPI Proxy - invalid "content-length"
2 parents 41d8fc4 + 4617240 commit fbda250

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Controller/ExAppProxyController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,16 @@ private function buildHeadersWithExclude(array $route, array $headers): array {
324324
if (!in_array('x-origin-ip', $headersToExclude)) {
325325
$headersToExclude[] = 'x-origin-ip';
326326
}
327+
if (!in_array('content-length', $headersToExclude)) {
328+
$headersToExclude[] = 'content-length';
329+
}
327330
$headersToExclude[] = 'authorization-app-api';
328331
foreach ($headers as $key => $value) {
329332
if (in_array(strtolower($key), $headersToExclude)) {
330333
unset($headers[$key]);
331334
}
332335
}
333-
$headers['X-Origin-IP'] = $this->request->getRemoteAddress();
336+
$headers['x-origin-ip'] = $this->request->getRemoteAddress();
334337
return $headers;
335338
}
336339
}

0 commit comments

Comments
 (0)