Bugfix/check token for edit locally requests#5039
Conversation
| const auto checkTokenForEditLocally = new SimpleApiJob(accountFound->account(), QStringLiteral("/ocs/v2.php/apps/files/api/v1/openlocaleditor/%1").arg(token)); | ||
| checkTokenForEditLocally->setVerb(SimpleApiJob::Verb::Post); | ||
| checkTokenForEditLocally->setBody(QByteArray{"1path=/"}.append(relPath.toUtf8())); | ||
| constexpr auto HTTP_OK_CODE = 200; |
There was a problem hiding this comment.
@mgallien Do you really need that for just a single use? Would not it be better to just use 200 inside the if?
There was a problem hiding this comment.
I disagree
though indeed we could have a simple header that would define those constants globally
|
|
||
| const auto checkTokenForEditLocally = new SimpleApiJob(accountFound->account(), QStringLiteral("/ocs/v2.php/apps/files/api/v1/openlocaleditor/%1").arg(token)); | ||
| checkTokenForEditLocally->setVerb(SimpleApiJob::Verb::Post); | ||
| checkTokenForEditLocally->setBody(QByteArray{"1path=/"}.append(relPath.toUtf8())); |
There was a problem hiding this comment.
@mgallien Can not you use something like QString Folder::remotePath() to construct the absolute remote path? Having this path=/ with a slash looks unreliable.
There was a problem hiding this comment.
will have a look
thanks for suggestion
There was a problem hiding this comment.
could not make it work
dd723c3 to
0a00b8d
Compare
|
@mgallien Please do not forget clean-up the history |
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
check on server that the token received during a request to open a local file is indeed a valid one Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
fcf112a to
f9949ee
Compare
|
AppImage file: nextcloud-PR-5039-f9949ee0de1b8a42412f528dc1f64e080eb44316-x86_64.AppImage |
|
SonarCloud Quality Gate failed. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #5039 +/- ##
==========================================
+ Coverage 57.34% 57.37% +0.03%
==========================================
Files 138 138
Lines 17391 17418 +27
==========================================
+ Hits 9972 9993 +21
- Misses 7419 7425 +6
|
|
/backport to stable-3.6 |








No description provided.