From 58735886bb438c522c9e0f6fc570e35da7d203af Mon Sep 17 00:00:00 2001 From: lizhi Date: Sun, 25 Jun 2023 15:54:40 +0800 Subject: [PATCH] 1. update pom --- src/main/java/irita/sdk/client/GrpcBSNInterceptor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/irita/sdk/client/GrpcBSNInterceptor.java b/src/main/java/irita/sdk/client/GrpcBSNInterceptor.java index a3725ba..ae1432b 100644 --- a/src/main/java/irita/sdk/client/GrpcBSNInterceptor.java +++ b/src/main/java/irita/sdk/client/GrpcBSNInterceptor.java @@ -9,6 +9,7 @@ public class GrpcBSNInterceptor implements ClientInterceptor { private final OpbConfig opbConfig; private final Metadata.Key PROJECT_ID_HEADER = Metadata.Key.of("projectIdHeader", Metadata.ASCII_STRING_MARSHALLER); private final Metadata.Key PROJECT_KEY_HEADER = Metadata.Key.of("projectKeyHeader", Metadata.ASCII_STRING_MARSHALLER); + private final Metadata.Key API_PROJECT_KEY_HEADER = Metadata.Key.of("x-api-key", Metadata.ASCII_STRING_MARSHALLER); private final Metadata.Key CHAIN_ACCOUNT_ADDRESS_HEADER = Metadata.Key.of("chainAccountAddressHeader", Metadata.ASCII_STRING_MARSHALLER); public GrpcBSNInterceptor(OpbConfig opbConfig) { @@ -23,6 +24,7 @@ public void start(Listener responseListener, Metadata headers) { if (opbConfig != null) { headers.put(PROJECT_ID_HEADER, Optional.ofNullable(opbConfig.getProjectID()).orElse("")); headers.put(PROJECT_KEY_HEADER, Optional.ofNullable(opbConfig.getProjectKey()).orElse("")); + headers.put(API_PROJECT_KEY_HEADER, Optional.ofNullable(opbConfig.getProjectKey()).orElse("")); headers.put(CHAIN_ACCOUNT_ADDRESS_HEADER, Optional.ofNullable(opbConfig.getChainAccountAddr()).orElse("")); if (opbConfig.getHeader() != null){ for (String key : opbConfig.getHeader().keySet()){