-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix/check token for edit locally requests #5039
Conversation
src/gui/folderman.cpp
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree
though indeed we could have a simple header that would define those constants globally
src/gui/folderman.cpp
Outdated
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will have a look
thanks for suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could not make it work
dd723c3
to
0a00b8d
Compare
@mgallien Please do not forget clean-up the history |
Signed-off-by: Matthieu Gallien <[email protected]>
Signed-off-by: Matthieu Gallien <[email protected]>
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 <[email protected]>
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.