File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @clerk/backend " : patch
3
+ ---
4
+
5
+ Use Headers constructor when building BAPI client headers
Original file line number Diff line number Diff line change @@ -102,14 +102,14 @@ export function buildRequest(options: BuildRequestOptions) {
102
102
}
103
103
104
104
// Build headers
105
- const headers : Record < string , any > = {
105
+ const headers = new Headers ( {
106
106
'Clerk-API-Version' : SUPPORTED_BAPI_VERSION ,
107
107
'User-Agent' : userAgent ,
108
108
...headerParams ,
109
- } ;
109
+ } ) ;
110
110
111
111
if ( secretKey ) {
112
- headers . Authorization = `Bearer ${ secretKey } ` ;
112
+ headers . set ( ' Authorization' , `Bearer ${ secretKey } ` ) ;
113
113
}
114
114
115
115
let res : Response | undefined ;
@@ -122,7 +122,7 @@ export function buildRequest(options: BuildRequestOptions) {
122
122
} ) ;
123
123
} else {
124
124
// Enforce application/json for all non form-data requests
125
- headers [ 'Content-Type' ] = 'application/json' ;
125
+ headers . set ( 'Content-Type' , 'application/json' ) ;
126
126
127
127
const buildBody = ( ) => {
128
128
const hasBody = method !== 'GET' && bodyParams && Object . keys ( bodyParams ) . length > 0 ;
You can’t perform that action at this time.
0 commit comments