s3 api: parse x-id query parameter and warn of any inconsistency (fix #822)
This commit is contained in:
parent
63f20bdeab
commit
c1b39d9ba1
1 changed files with 14 additions and 1 deletions
|
@ -352,6 +352,18 @@ impl Endpoint {
|
||||||
_ => return Err(Error::bad_request("Unknown method")),
|
_ => return Err(Error::bad_request("Unknown method")),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if let Some(x_id) = query.x_id.take() {
|
||||||
|
if x_id != res.name() {
|
||||||
|
// I think AWS ignores the x-id parameter.
|
||||||
|
// Let's make this at least be a warnin to help debugging.
|
||||||
|
warn!(
|
||||||
|
"x-id ({}) does not match parsed endpoint ({})",
|
||||||
|
x_id,
|
||||||
|
res.name()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(message) = query.nonempty_message() {
|
if let Some(message) = query.nonempty_message() {
|
||||||
debug!("Unused query parameter: {}", message)
|
debug!("Unused query parameter: {}", message)
|
||||||
}
|
}
|
||||||
|
@ -696,7 +708,8 @@ generateQueryParameters! {
|
||||||
"uploadId" => upload_id,
|
"uploadId" => upload_id,
|
||||||
"upload-id-marker" => upload_id_marker,
|
"upload-id-marker" => upload_id_marker,
|
||||||
"versionId" => version_id,
|
"versionId" => version_id,
|
||||||
"version-id-marker" => version_id_marker
|
"version-id-marker" => version_id_marker,
|
||||||
|
"x-id" => x_id
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue