Skip to content

Commit 2374d55

Browse files
authored
Proxy: do not set timeout for requests to ExApp (#357)
We forgot to change this in this PR: #277 For Proxy requests there should be no timeout, cause they are coming from user or external services and not from Nextcloud Even if they will take a long time, Nextcloud instance will be not slow down Signed-off-by: Alexander Piskun <[email protected]>
1 parent 42fdee1 commit 2374d55

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/Controller/ExAppProxyController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public function ExAppGet(string $appId, string $other): Response {
9191
$exApp, '/' . $other, $this->userId, 'GET', queryParams: $_GET, options: [
9292
RequestOptions::COOKIES => $this->buildProxyCookiesJar($_COOKIE, $this->service->getExAppDomain($exApp)),
9393
RequestOptions::HEADERS => $this->buildHeadersWithExclude($exApp, $other, getallheaders()),
94+
RequestOptions::TIMEOUT => 0,
9495
],
9596
request: $this->request,
9697
);
@@ -112,6 +113,7 @@ public function ExAppPost(string $appId, string $other): Response {
112113
$options = [
113114
RequestOptions::COOKIES => $this->buildProxyCookiesJar($_COOKIE, $this->service->getExAppDomain($exApp)),
114115
RequestOptions::HEADERS => $this->buildHeadersWithExclude($exApp, $other, getallheaders()),
116+
RequestOptions::TIMEOUT => 0,
115117
];
116118
if (str_starts_with($this->request->getHeader('Content-Type'), 'multipart/form-data') || count($_FILES) > 0) {
117119
unset($options['headers']['Content-Type']);
@@ -149,6 +151,7 @@ public function ExAppPut(string $appId, string $other): Response {
149151
RequestOptions::COOKIES => $this->buildProxyCookiesJar($_COOKIE, $this->service->getExAppDomain($exApp)),
150152
RequestOptions::BODY => $stream,
151153
RequestOptions::HEADERS => $this->buildHeadersWithExclude($exApp, $other, getallheaders()),
154+
RequestOptions::TIMEOUT => 0,
152155
];
153156
$response = $this->service->requestToExApp2(
154157
$exApp, '/' . $other, $this->userId, 'PUT',
@@ -175,6 +178,7 @@ public function ExAppDelete(string $appId, string $other): Response {
175178
RequestOptions::COOKIES => $this->buildProxyCookiesJar($_COOKIE, $this->service->getExAppDomain($exApp)),
176179
RequestOptions::BODY => $stream,
177180
RequestOptions::HEADERS => $this->buildHeadersWithExclude($exApp, $other, getallheaders()),
181+
RequestOptions::TIMEOUT => 0,
178182
];
179183
$response = $this->service->requestToExApp2(
180184
$exApp, '/' . $other, $this->userId, 'DELETE',

tests/psalm-baseline.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
<code><![CDATA[RequestOptions]]></code>
2727
<code><![CDATA[RequestOptions]]></code>
2828
<code><![CDATA[RequestOptions]]></code>
29+
<code><![CDATA[RequestOptions]]></code>
30+
<code><![CDATA[RequestOptions]]></code>
31+
<code><![CDATA[RequestOptions]]></code>
32+
<code><![CDATA[RequestOptions]]></code>
2933
<code><![CDATA[SetCookie]]></code>
3034
</UndefinedClass>
3135
</file>

0 commit comments

Comments
 (0)