Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

- Restore top-level _performance_issues_spans. ([#6045](https://github.com/getsentry/relay/pull/6045))
- Update sentry-conventions to 0.11.0, migrating deprecated `gen_ai` attribute constants. ([#6068](https://github.com/getsentry/relay/pull/6068))
- Prefix upload location query params for forward compatibility. ([#6076](https://github.com/getsentry/relay/pull/6076))

## 26.5.2

Expand Down
12 changes: 9 additions & 3 deletions relay-server/src/endpoints/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ impl IntoResponse for Error {
upload::Error::InvalidLocation(_) | upload::Error::SigningFailed => {
StatusCode::INTERNAL_SERVER_ERROR
}
upload::Error::SerializeFailed(_) => StatusCode::INTERNAL_SERVER_ERROR,
upload::Error::InvalidSignature => StatusCode::BAD_REQUEST,
upload::Error::ObjectstoreServiceUnavailable(_) => StatusCode::SERVICE_UNAVAILABLE,
#[cfg(feature = "processing")]
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