mirror of
https://github.com/denoland/deno.git
synced 2025-01-05 13:59:01 -05:00
enable a test case 'ClientRequest search params'
This commit is contained in:
parent
007b5265b8
commit
8d41fbc2da
2 changed files with 9 additions and 8 deletions
|
@ -167,9 +167,11 @@ where
|
|||
|
||||
let mut request = http::Request::new(body);
|
||||
*request.method_mut() = method.clone();
|
||||
*request.uri_mut() = url_parsed
|
||||
.path()
|
||||
.to_string()
|
||||
let path = url_parsed.path();
|
||||
let query = url_parsed.query();
|
||||
*request.uri_mut() = query
|
||||
.map(|q| format!("{}?{}", path, q))
|
||||
.unwrap_or_else(|| path.to_string())
|
||||
.parse()
|
||||
.map_err(|_| type_error("Invalid URL"))?;
|
||||
*request.headers_mut() = header_map;
|
||||
|
|
|
@ -794,14 +794,13 @@ Deno.test("[node/http] ClientRequest PUT", async () => {
|
|||
assertEquals(body, "hello world");
|
||||
});
|
||||
|
||||
Deno.test("[node/http] ClientRequest search params", {
|
||||
ignore: true,
|
||||
}, async () => {
|
||||
Deno.test("[node/http] ClientRequest search params", async () => {
|
||||
let body = "";
|
||||
const { promise, resolve, reject } = Promise.withResolvers<void>();
|
||||
const req = http.request({
|
||||
host: "localhost:4545",
|
||||
path: "search_params?foo=bar",
|
||||
host: "localhost",
|
||||
port: 4545,
|
||||
path: "/search_params?foo=bar",
|
||||
}, (resp) => {
|
||||
resp.on("data", (chunk) => {
|
||||
body += chunk;
|
||||
|
|
Loading…
Reference in a new issue