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

[ws client]: parse path from the URL #335

Merged
merged 4 commits into from
May 25, 2021
Merged

[ws client]: parse path from the URL #335

merged 4 commits into from
May 25, 2021

Conversation

niklasad1
Copy link
Member

Closing #306

This commit changes that the path/HTTP resource path is parsed from the URL and removes that option
from WsClientBuilder.

This commit changes that the path/HTTP resource path is parsed from the URL and removes that option
from WsClientBuilder.
/// Sets the URL to pass during the HTTP handshake.
///
/// The default URL is `/`.
pub fn with_handshake_url(mut self, url: impl Into<Cow<'a, str>>) -> Self {
Copy link
Member Author

Choose a reason for hiding this comment

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

unsed, thus removed.

@@ -175,8 +175,7 @@ pub struct WsClientBuilder<'a> {
max_request_body_size: u32,
request_timeout: Option<Duration>,
connection_timeout: Duration,
origin: Option<Cow<'a, str>>,
handshake_url: Cow<'a, str>,
Copy link
Member Author

Choose a reason for hiding this comment

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

removed this and parses it from the URL instead

@@ -210,8 +208,8 @@ impl<'a> WsClientBuilder<'a> {
}

/// Set request timeout.
pub fn request_timeout(mut self, timeout: Option<Duration>) -> Self {
Copy link
Member Author

Choose a reason for hiding this comment

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

annoying builder method; unrelated to this PR

@@ -210,8 +208,8 @@ impl<'a> WsClientBuilder<'a> {
}

/// Set request timeout.
pub fn request_timeout(mut self, timeout: Option<Duration>) -> Self {
self.request_timeout = timeout;
pub fn request_timeout(mut self, timeout: Duration) -> Self {
Copy link
Member Author

Choose a reason for hiding this comment

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

annoying builder method; unrelated to this PR

@chevdor
Copy link
Contributor

chevdor commented May 24, 2021

I tested the fix and that's a PASS for me.

Copy link
Contributor

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

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

Good sleuthing here. Left a few suggestions, up to you if you want to implement them. :)

ws-client/src/client.rs Outdated Show resolved Hide resolved
ws-client/src/transport.rs Outdated Show resolved Hide resolved
ws-client/src/transport.rs Outdated Show resolved Hide resolved
Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

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

I like the change. 👍 LGTM

@niklasad1 niklasad1 merged commit a60896e into master May 25, 2021
@niklasad1 niklasad1 deleted the na-fix-306 branch May 25, 2021 08:58
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.

4 participants