Skip to content

[bug] http api timeout doesn't work #4050

@qu1ck

Description

@qu1ck

Describe the bug

Timeout value passed as parameter in HttpOptions has no effect.

Reproduction

    var client = await http.getClient(
        { connectTimeout: 2, maxRedirections: 3 });
    var response = await client.get(
        "https://httpstat.us/200?sleep=9000",
        {responseType: ResponseType.Text, timeout: 2});

Expected behavior

The request times out

Platform and versions

Environment
  › OS: Windows 10.0.19044 X64
  › Webview2: 101.0.1210.32
  › MSVC:
      - Visual Studio Community 2019
  › Node.js: 16.14.2
  › npm: 8.5.0
  › pnpm: Not installed!
  › yarn: Not installed!
  › rustup: 1.24.3
  › rustc: 1.59.0
  › cargo: 1.59.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc

Packages
  › @tauri-apps/cli [NPM]: 1.0.0-rc.9
  › @tauri-apps/api [NPM]: 1.0.0-rc.4
  › tauri [RUST]: git+https://github.com/tauri-apps/tauri.git?rev=eaf9e5a#eaf9e5a9a6c0959be46d2969a423ef7689ea9225 (1.0.0-rc.8),
  › tauri-build [RUST]: 1.0.0-rc.7,
  › tao [RUST]: 0.8.3,
  › wry [RUST]: 0.15.1,

Stack trace

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions