This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
uploader: respect Content-Type from MIME part header #276
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It makes sense in general (since HTTP Content-Type is multipart/form) and browsers usually set it. This will help have a more secure send.fs.neo.org since explicit Content-Type is then always returned for GETs (otherwise it's autodetected). Signed-off-by: Roman Khimov <roman@nspcc.ru>
Codecov Report
@@ Coverage Diff @@
## master #276 +/- ##
==========================================
- Coverage 34.39% 34.24% -0.15%
==========================================
Files 10 10
Lines 1378 1384 +6
==========================================
Hits 474 474
- Misses 862 868 +6
Partials 42 42
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Can't find any other mismatch, so fixes #272. Signed-off-by: Roman Khimov <roman@nspcc.ru>
Not critical for HTTP gateway itself, but asymmetric and causes panic on attempt to perform tests with two AIO versions: --- FAIL: TestIntegration (48.12s) panic: duplicate metrics collector registration attempted [recovered] panic: duplicate metrics collector registration attempted goroutine 5 [running]: testing.tRunner.func1.2({0x1035fe0, 0xc00674db80}) /usr/lib64/go/1.20/src/testing/testing.go:1526 +0x24e testing.tRunner.func1() /usr/lib64/go/1.20/src/testing/testing.go:1529 +0x39f panic({0x1035fe0, 0xc00674db80}) /usr/lib64/go/1.20/src/runtime/panic.go:884 +0x213 github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(0x113c8f3?, {0xc007063ac0?, 0x1, 0xf?}) /home/rik/go/pkg/mod/github.com/prometheus/client_golang@v1.14.0/prometheus/registry.go:406 +0x85 github.com/prometheus/client_golang/prometheus.MustRegister(...) /home/rik/go/pkg/mod/github.com/prometheus/client_golang@v1.14.0/prometheus/registry.go:178 github.com/nspcc-dev/neofs-http-gw/metrics.stateMetrics.register({{0x1393af0?, 0xc0077786c0?}, 0xc000627448?}) /home/rik/dev/neofs-http-gw/metrics/metrics.go:95 +0xfd github.com/nspcc-dev/neofs-http-gw/metrics.NewGateMetrics(0x113bb40?, 0x7?) /home/rik/dev/neofs-http-gw/metrics/metrics.go:58 +0x45 github.com/nspcc-dev/neofs-http-gw.(*app).initMetrics(0xc0076248c0) /home/rik/dev/neofs-http-gw/app.go:213 +0x54 github.com/nspcc-dev/neofs-http-gw.newApp({0x138cf08, 0xc006d928c0}, {0xc005135cc8, 0x2, 0x0?}) /home/rik/dev/neofs-http-gw/app.go:185 +0x1045 github.com/nspcc-dev/neofs-http-gw.runServer() /home/rik/dev/neofs-http-gw/integration_test.go:103 +0x125 github.com/nspcc-dev/neofs-http-gw.TestIntegration(0x0?) /home/rik/dev/neofs-http-gw/integration_test.go:78 +0x3fe testing.tRunner(0xc000102680, 0x1261428) /usr/lib64/go/1.20/src/testing/testing.go:1576 +0x10b created by testing.(*T).Run /usr/lib64/go/1.20/src/testing/testing.go:1629 +0x3ea Signed-off-by: Roman Khimov <roman@nspcc.ru>
Signed-off-by: Roman Khimov <roman@nspcc.ru>
It was needed before neofs-aio 0.37.0. Signed-off-by: Roman Khimov <roman@nspcc.ru>
AIO was updated to solve this. Signed-off-by: Roman Khimov <roman@nspcc.ru>
roman-khimov
force-pushed
the
use-file-content-type-from-request
branch
from
September 17, 2023 19:37
596aa7c
to
b71e885
Compare
smallhive
reviewed
Sep 18, 2023
smallhive
approved these changes
Sep 18, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It makes sense in general (since HTTP Content-Type is multipart/form) and browsers usually set it. This will help to have a more secure send.fs.neo.org since explicit Content-Type is then always returned for GETs (otherwise it's autodetected).