From: wuhongsong Date: Thu, 9 Apr 2026 10:16:31 +0000 (+0800) Subject: rgw: add Content-Type header to Vault KMS requests X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6e56c705b90b1e9cc5d99e72b0dfc1bbbffcbf18;p=ceph.git rgw: add Content-Type header to Vault KMS requests RGW sends JSON POST requests to Vault Transit API without setting the Content-Type header, causing libcurl to default to application/x-www-form-urlencoded. While standard HashiCorp Vault tolerates this, Vault-compatible implementations that use strict HTTP frameworks reject such requests with 415 Unsupported Media Type. Add Content-Type: application/json to POST requests in VaultSecretEngine::send_request(), consistent with all other RGW modules that send JSON (rgw_keystone.cc, rgw_opa.cc, rgw_pubsub_push.cc, rgw_sync_module_es.cc). Signed-off-by: wuhongsong --- diff --git a/src/rgw/rgw_kms.cc b/src/rgw/rgw_kms.cc index 9cca90aa3b5c..e089b4ec25fa 100644 --- a/src/rgw/rgw_kms.cc +++ b/src/rgw/rgw_kms.cc @@ -288,6 +288,7 @@ protected: if (postdata.length()) { secret_req.set_post_data(postdata); secret_req.set_send_length(postdata.length()); + secret_req.append_header("Content-Type", "application/json"); } if (!vault_token.empty()) {