Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add client-request-method to CORS allowed headers (#20160) #20168

Merged
merged 2 commits into from
Nov 4, 2024
Merged
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 crates/sui-json-rpc-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ pub fn read_size_from_env(var_name: &str) -> Option<usize> {
.ok()
}

pub const CLIENT_REQUEST_METHOD_HEADER: &str = "client-request-method";
pub const CLIENT_SDK_TYPE_HEADER: &str = "client-sdk-type";
/// The version number of the SDK itself. This can be different from the API version.
pub const CLIENT_SDK_VERSION_HEADER: &str = "client-sdk-version";
Expand Down
4 changes: 3 additions & 1 deletion crates/sui-json-rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ pub use balance_changes::*;
pub use object_changes::*;
pub use sui_config::node::ServerType;
use sui_json_rpc_api::{
CLIENT_SDK_TYPE_HEADER, CLIENT_SDK_VERSION_HEADER, CLIENT_TARGET_API_VERSION_HEADER,
CLIENT_REQUEST_METHOD_HEADER, CLIENT_SDK_TYPE_HEADER, CLIENT_SDK_VERSION_HEADER,
CLIENT_TARGET_API_VERSION_HEADER,
};
use sui_open_rpc::{Module, Project};

Expand Down Expand Up @@ -121,6 +122,7 @@ impl JsonRpcServerBuilder {
HeaderName::from_static(CLIENT_SDK_VERSION_HEADER),
HeaderName::from_static(CLIENT_TARGET_API_VERSION_HEADER),
HeaderName::from_static(APP_NAME_HEADER),
HeaderName::from_static(CLIENT_REQUEST_METHOD_HEADER),
]);
Ok(cors)
}
Expand Down
Loading