add ClientBuilder.default_headers() for wasm32 target (#1084)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
|
||||
#[cfg(feature = "__tls")]
|
||||
#[tokio::test]
|
||||
async fn test_badssl_modern() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
mod support;
|
||||
use futures_util::stream::StreamExt;
|
||||
use support::*;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
mod support;
|
||||
use futures_util::stream::StreamExt;
|
||||
use support::*;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
mod support;
|
||||
use support::*;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
mod support;
|
||||
use futures_util::stream::StreamExt;
|
||||
use support::*;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
use std::convert::Infallible;
|
||||
use std::future::Future;
|
||||
use std::net;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
mod support;
|
||||
use support::*;
|
||||
|
||||
|
||||
24
tests/wasm_simple.rs
Normal file
24
tests/wasm_simple.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
#![cfg(target_arch = "wasm32")]
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_test::*;
|
||||
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
// Use `js_namespace` here to bind `console.log(..)` instead of just
|
||||
// `log(..)`
|
||||
#[wasm_bindgen(js_namespace = console)]
|
||||
fn log(s: &str);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
async fn simple_example() {
|
||||
let res = reqwest::get("https://hyper.rs")
|
||||
.await
|
||||
.expect("http get example");
|
||||
log(&format!("Status: {}", res.status()));
|
||||
|
||||
let body = res.text().await.expect("response to utf-8 text");
|
||||
log(&format!("Body:\n\n{}", body));
|
||||
}
|
||||
Reference in New Issue
Block a user