all: sync with master
This commit is contained in:
@@ -54,9 +54,12 @@ set -f -u
|
||||
#
|
||||
# * Package unsafe is… unsafe.
|
||||
#
|
||||
# Currently, the only standard exception are files generated from protobuf
|
||||
# schemas, which use package reflect. If your project needs more exceptions,
|
||||
# add and document them.
|
||||
# If your project needs more exceptions, add and document them. Currently,
|
||||
# there are only two standard exceptions:
|
||||
#
|
||||
# * Files generated from protobuf schemas, which use package reflect.
|
||||
#
|
||||
# * Windows-specific code caused by golang.org/x/sys/windows API design.
|
||||
#
|
||||
# TODO(a.garipov): Add golibs/log.
|
||||
#
|
||||
@@ -75,6 +78,7 @@ blocklist_imports() {
|
||||
-n\
|
||||
-- '*.go'\
|
||||
':!*.pb.go'\
|
||||
':!./internal/aghos/permission_windows.go'\
|
||||
| sed -e 's/^\([^[:space:]]\+\)\(.*\)$/\1 blocked import:\2/'\
|
||||
|| exit 0
|
||||
}
|
||||
|
||||
@@ -4,16 +4,17 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/textproto"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
|
||||
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
|
||||
"github.com/AdguardTeam/golibs/errors"
|
||||
"github.com/AdguardTeam/golibs/httphdr"
|
||||
"github.com/AdguardTeam/golibs/mapsutil"
|
||||
)
|
||||
|
||||
// upload base translation.
|
||||
@@ -52,9 +53,11 @@ func prepareMultipartMsg(
|
||||
w := multipart.NewWriter(buf)
|
||||
var fw io.Writer
|
||||
|
||||
err = mapsutil.SortedRangeError(formData, w.WriteField)
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("writing field: %w", err)
|
||||
for _, k := range slices.Sorted(maps.Keys(formData)) {
|
||||
err = w.WriteField(k, formData[k])
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("writing field %q: %w", k, err)
|
||||
}
|
||||
}
|
||||
|
||||
file, err := os.Open(basePath)
|
||||
|
||||
Reference in New Issue
Block a user