-
Notifications
You must be signed in to change notification settings - Fork 112
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
fix share path when listing a specific share #1918
Conversation
@C0rby I think this one is related with #1739 |
@C0rby the share prefix should only be prepended if the user is a recipient of the share. For share creators who want to get a share by ID, it should be skipped. |
@C0rby can you update? |
Yes, you're right. I'll update the code. |
The thing is this method calls |
Ah, I didn't notice that.. Yeah, that makes it a bit more difficult... |
8869b1e
to
f43f7d8
Compare
Now I added an extra request to get the received share in the case if the current user is not the owner. The received share contains the state information. It is one additional request but shouldn't be too costly IMO. |
Exactly. I did the same in a previous PR. 👍 |
|
||
if receivedShare != nil && receivedShare.State == collaboration.ShareState_SHARE_STATE_ACCEPTED { | ||
// Needed because received shares can be jailed in a folder in the users home | ||
share.FileTarget = path.Join(h.sharePrefix, path.Base(info.Path)) |
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.
This breaks global urls for accessing shares as you're forcing a basePath for FileTarget
and Path
.
It needs #1739 to be merged first and apply the same logic if I didn't miss anything.
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.
f43f7d8
to
ec342e0
Compare
AFAICT this PR is no longer necessary since the changes in |
The file path and target of shares where missing the share jail path when a specific share was listed.