From 3d8af05037f04f51b1505f5aa87c5b1a5826c849 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Tue, 6 Oct 2020 17:28:20 +0200 Subject: [PATCH] Use friendly user agent during webflow2 auth This way the server displays a less scary string while granting access from the browser. Also this same string will be used in the "Devices and sessions" section of the server settings. Signed-off-by: Kevin Ottens --- src/gui/creds/flow2auth.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/creds/flow2auth.cpp b/src/gui/creds/flow2auth.cpp index b4e826d46..790318e83 100644 --- a/src/gui/creds/flow2auth.cpp +++ b/src/gui/creds/flow2auth.cpp @@ -82,6 +82,7 @@ void Flow2Auth::fetchNewToken(const TokenAction action) // add 'Content-Length: 0' header (see https://github.com/nextcloud/desktop/issues/1473) QNetworkRequest req; req.setHeader(QNetworkRequest::ContentLengthHeader, "0"); + req.setRawHeader("User-Agent", Utility::friendlyUserAgentString()); auto job = _account->sendRequest("POST", url, req); job->setTimeout(qMin(30 * 1000ll, job->timeoutMsec())); -- 2.30.2