Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(http): refactor and improvements #428

Merged
merged 12 commits into from
Aug 7, 2023
Merged

feat(http): refactor and improvements #428

merged 12 commits into from
Aug 7, 2023

Conversation

amrbashir
Copy link
Member

No description provided.

@amrbashir amrbashir requested a review from a team as a code owner June 8, 2023 17:21
@lucasfernog
Copy link
Member

We need to keep client options somehow though.

interface ClientOptions {
  /**
   * Defines the maximum number of redirects the client should follow.
   * If set to 0, no redirects will be followed.
   */
  maxRedirections?: number;
  connectTimeout?: number | Duration;
}

@lucasfernog lucasfernog changed the title feat(http): refactor and improvemnts feat(http): refactor and improvements Jun 18, 2023
@amrbashir
Copy link
Member Author

yeah I think, I will add a function overload to take a 3rd argument for these options

@lucasfernog
Copy link
Member

Sounds good. Could also add it to the second argument I think (along with body, headers etc right?).

@amrbashir
Copy link
Member Author

amrbashir commented Jun 19, 2023

It could, I will have to test, but I think it makes sense to have it separated so it doesn't conflict with web spec at all now or in the future.

@amrbashir
Copy link
Member Author

I ended up extending the second argument.

@james138138
Copy link

@lucasfernog @amrbashir Thanks to create plugin. We have use case where application needs to call self signed intranet api. Could we expand scope from HttpAllowlistScope(pub Vec<String>) to HttpAllowlistScope(pub Vec<(String, bool)>)` , the 2nd item can be used to accept invalid certs for that domain? I'm happy to help if agreed.

@amrbashir
Copy link
Member Author

@james138138 Please open another issue to discuss your feature.

}

type Part = string | Uint8Array | FilePart<Uint8Array>;
class TauriResponse extends Response {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we need to extend and override Response methods? Was new Response(dataAsBytes) not enough?

lucasfernog
lucasfernog previously approved these changes Aug 7, 2023
@lucasfernog lucasfernog merged commit 7d9df72 into v2 Aug 7, 2023
@lucasfernog lucasfernog deleted the feat/http/refactor branch August 7, 2023 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants