mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
GODT-175: Add option to attach logs for bug reports
This commit is contained in:
@ -38,7 +38,7 @@ func (m *manager) ReportBug(ctx context.Context, rep ReportBugReq) error {
|
||||
r := m.r(ctx).SetMultipartFormData(rep.GetMultipartFormData())
|
||||
|
||||
for _, att := range rep.Attachments {
|
||||
r = r.SetMultipartField(att.name, att.filename, "application/octet-stream", att.body)
|
||||
r = r.SetMultipartField(att.name, att.name, att.mime, att.body)
|
||||
}
|
||||
|
||||
if _, err := wrapNoConnection(r.Post("/reports/bug")); err != nil {
|
||||
|
||||
@ -29,8 +29,8 @@ const (
|
||||
)
|
||||
|
||||
type reportAtt struct {
|
||||
name, filename string
|
||||
body io.Reader
|
||||
name, mime string
|
||||
body io.Reader
|
||||
}
|
||||
|
||||
// ReportBugReq stores data for report.
|
||||
@ -56,8 +56,8 @@ type ReportBugReq struct {
|
||||
}
|
||||
|
||||
// AddAttachment to report.
|
||||
func (rep *ReportBugReq) AddAttachment(name, filename string, r io.Reader) {
|
||||
rep.Attachments = append(rep.Attachments, reportAtt{name: name, filename: filename, body: r})
|
||||
func (rep *ReportBugReq) AddAttachment(name, mime string, r io.Reader) {
|
||||
rep.Attachments = append(rep.Attachments, reportAtt{name: name, mime: mime, body: r})
|
||||
}
|
||||
|
||||
func (rep *ReportBugReq) GetMultipartFormData() map[string]string {
|
||||
|
||||
Reference in New Issue
Block a user