Compare commits

..

2 Commits

Author SHA1 Message Date
269937ff09 Remove login information from update request
All checks were successful
Check PR code / translations (pull_request) Successful in 38s
Check PR code / Lint (pull_request) Successful in 49s
Check PR code / build (pull_request) Successful in 35s
Removed the username and password in the GET /update request.
The endpoint does not require authentication and it is unsafe to transmit login credentials over GET requests.
2025-04-12 22:48:42 +02:00
a7bc64d61e Support SSE for source updates
This uses the Server Side Events added in Selfoss API 6.1.0 when calling GET /update
This change only supports the new response format but provides no change for the users.
The older versions are still supported.
2025-04-12 22:43:24 +02:00

View File

@ -365,12 +365,22 @@ class SelfossApi(
suspend fun update(): StatusAndData<String> = suspend fun update(): StatusAndData<String> =
bodyOrFailure( bodyOrFailure(
client.tryToGet(url("/update")) { client.tryToGet(url("/update")) {
if (!shouldHavePostLogin()) {
parameter("username", appSettingsService.getUserName())
parameter("password", appSettingsService.getPassword())
}
if (appSettingsService
.getBasicUserName()
.isNotEmpty() &&
appSettingsService.getBasicPassword().isNotEmpty()
) {
headers { headers {
append( append(
HttpHeaders.Accept, HttpHeaders.Accept,
"text/event-stream", "text/event-stream",
) )
} }
}
}, },
) )