Skip to content
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Have relay generate metric billing outcomes. ([#6066](https://github.com/getsentry/relay/pull/6066))
- Update sentry-conventions to 0.12.0.
- Upgrade release image to Debian 13. ([#6110](https://github.com/getsentry/relay/pull/6110))
- Prefix upload location query params for forward compatibility. ([#6076](https://github.com/getsentry/relay/pull/6076))

## 26.6.0

Expand Down
14 changes: 10 additions & 4 deletions relay-server/src/endpoints/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ impl IntoResponse for Error {
upload::Error::InvalidLocation(_) | upload::Error::SigningFailed => {
StatusCode::INTERNAL_SERVER_ERROR
}
upload::Error::InvalidSignature => StatusCode::BAD_REQUEST,
upload::Error::SerializeFailed(_) => StatusCode::INTERNAL_SERVER_ERROR,
upload::Error::InvalidSignature(_) => StatusCode::BAD_REQUEST,
upload::Error::ObjectstoreServiceUnavailable(_) => StatusCode::SERVICE_UNAVAILABLE,
#[cfg(feature = "processing")]
upload::Error::Objectstore(service_error) => match service_error.kind {
Expand Down Expand Up @@ -200,15 +201,20 @@ async fn handle_patch(
meta: RequestMeta,
headers: HeaderMap,
Path(upload::LocationPath { project_id, key }): Path<upload::LocationPath>,
Query(LocationQueryParams { length, signature }): Query<LocationQueryParams<Provisional>>,
Query(LocationQueryParams {
upload_length,
upload_signature,
other,
}): Query<LocationQueryParams<Provisional>>,
body: Body,
) -> axum::response::Result<impl IntoResponse> {
check_kill_switch(&state)?;

relay_log::trace!("Validating headers");
tus::validate_patch_headers(&headers).map_err(Error::from)?;

let location = SignedLocation::from_parts(project_id, key, length, signature);
let location =
SignedLocation::from_parts(project_id, key, upload_length, upload_signature, other);

let config = state.config();

Expand All @@ -233,7 +239,7 @@ async fn handle_patch(
.boxed();
let stream = MeteredStream::new(stream, "upload");

let (lower_bound, upper_bound) = match length.value() {
let (lower_bound, upper_bound) = match upload_length.value() {
None => (1, config.max_upload_size()),
Some(u) => (u, u),
};
Expand Down
Loading
Loading