-
Notifications
You must be signed in to change notification settings - Fork 64
Option to omit transfer on same storage volume #147
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
4ad2999
98f8795
b28dcac
2a1319a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -129,6 +129,20 @@ func postTransfers(c *gin.Context) { | |
| trnsfr.Server.Events().Publish(server.TransferStatusEvent, "success") | ||
| }(ctx, trnsfr) | ||
|
|
||
| { | ||
| remotePool := config.Get().System.Transfers.StoragePool | ||
| sourcePool := c.GetHeader("X-Storage-Pool") | ||
| if remotePool.Enabled && remotePool.PoolName != "" && sourcePool != "" && strings.EqualFold(remotePool.PoolName, sourcePool) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pool name comparison relies on an unauthenticated header value for a security-sensitive decision. While the request itself is authenticated via Bearer token, the Consider whether a stricter trust model is needed (e.g., the Panel could include the source pool name in the signed JWT transfer token instead of relying on a plain header). 🤖 Prompt for AI Agents |
||
| if err := trnsfr.Server.CreateEnvironment(); err != nil { | ||
| middleware.CaptureAndAbort(c, err) | ||
| return | ||
| } | ||
| successful = true | ||
| c.Status(http.StatusOK) | ||
| return | ||
| } | ||
| } | ||
|
|
||
| mediaType, params, err := mime.ParseMediaType(c.GetHeader("Content-Type")) | ||
| if err != nil { | ||
| trnsfr.Log().Debug("failed to parse content type header") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.