Skip to content

Commit

Permalink
signalmeow/attachments: remove auth from TUS upload request
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Nov 14, 2024
1 parent b538f47 commit 33ac0b4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/signalmeow/attachments.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (cli *Client) UploadAttachment(ctx context.Context, body []byte) (*signalpb
}
if uploadAttributes.Cdn == 3 {
log.Trace().Msg("Using TUS upload")
err = cli.uploadAttachmentTUS(ctx, uploadAttributes, encryptedWithMAC, username, password)
err = cli.uploadAttachmentTUS(ctx, uploadAttributes, encryptedWithMAC)
} else {
log.Trace().Msg("Using legacy upload")
err = cli.uploadAttachmentLegacy(ctx, uploadAttributes, encryptedWithMAC, username, password)
Expand Down Expand Up @@ -232,8 +232,6 @@ func (cli *Client) uploadAttachmentTUS(
ctx context.Context,
uploadAttributes attachmentV4UploadAttributes,
encryptedWithMAC []byte,
username string,
password string,
) error {
uploadAttributes.Headers["Tus-Resumable"] = "1.0.0"
uploadAttributes.Headers["Upload-Length"] = fmt.Sprintf("%d", len(encryptedWithMAC))
Expand All @@ -244,8 +242,6 @@ func (cli *Client) uploadAttachmentTUS(
Body: encryptedWithMAC,
ContentType: web.ContentTypeOffsetOctetStream,
Headers: uploadAttributes.Headers,
Username: &username,
Password: &password,
})
// TODO actually support resuming on error
if err != nil {
Expand Down

0 comments on commit 33ac0b4

Please sign in to comment.