File tree 1 file changed +11
-1
lines changed
crates/cli/src/bin/wasm-bindgen-test-runner
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: shell:: Shell ;
2
2
use anyhow:: { bail, format_err, Context , Error } ;
3
- use curl:: easy:: Easy ;
3
+ use curl:: easy:: { Easy , List } ;
4
4
use log:: { debug, warn} ;
5
5
use rouille:: url:: Url ;
6
6
use serde:: { Deserialize , Serialize } ;
@@ -522,6 +522,8 @@ impl Client {
522
522
match method {
523
523
Method :: Post ( data) => {
524
524
self . handle . post ( true ) ?;
525
+ self . handle
526
+ . http_headers ( build_headers ( & [ "Content-Type: application/json" ] ) ) ?;
525
527
self . handle . post_fields_copy ( data. as_bytes ( ) ) ?;
526
528
}
527
529
Method :: Delete => self . handle . custom_request ( "DELETE" ) ?,
@@ -561,6 +563,14 @@ impl Drop for Client {
561
563
}
562
564
}
563
565
566
+ fn build_headers ( headers : & [ & str ] ) -> List {
567
+ let mut list = List :: new ( ) ;
568
+ for header in headers {
569
+ list. append ( header) . unwrap ( ) ;
570
+ }
571
+ list
572
+ }
573
+
564
574
fn read < R : Read > ( r : & mut R ) -> io:: Result < Vec < u8 > > {
565
575
let mut dst = Vec :: new ( ) ;
566
576
r. read_to_end ( & mut dst) ?;
You can’t perform that action at this time.
0 commit comments