tauri-apps / tauri-apps/plugins-workspace
[http][v2] More ClientOptions for reqwest client builder
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 602
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 9
Description
Personally I need tls1.3 for request and I believe more available options give plugin flexibility.
https://docs.rs/reqwest/latest/reqwest/struct.ClientBuilder.html
What I expected for the TS interface
```typescript
export interface ClientOptions {
/**
* Defines the maximum number of redirects the client should follow.
* If set to 0, no redirects will be followed.
*/
maxRedirections?: number;
/** Timeout in milliseconds */
connectTimeout?: number;
/**
* Configuration of a proxy that a Client should pass requests to.
*/
proxy?: Proxy;
/**
* TLS version to use, need to set the feature flag
*/
tlsVersionRange?: {
// minimum TLS version 1.3 will cause an error with the native-tls/default-tls backend according to reqwest documentation
min: '10' | '11' | '12',
max: '10' | '11' | '12' | '13'
};
/**
* TLS provider to use, need to set the feature flag
*/
tlsProvider?: 'default' | 'rust-tls' | 'native-tls';
/**
* compression algorithms to use
*/
brotli?: boolean;
gzip?: boolean;
deflate?: boolean;
/**
* Set to `true` to accept invalid certificates
*/
dangerAcceptInvalidCertificates?: boolean;
/**
* Set to `true` to accept invalid hostnames
*/
dangerAcceptInvalidHostnames?: boolean;
/**
* HTTP protocol to use
*/
http1Only?: boolean;
http2Only?: boolean;
http3Only?: boolean;
httpsOnly?: boolean;
/**
* user-agent string
*/
userAgent?: string;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.