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

Update soketto requirement from 0.6 to 0.7 #493

Merged
merged 3 commits into from
Oct 5, 2021

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 30, 2021

Updates the requirements on soketto to permit the latest version.

Release notes

Sourced from soketto's releases.

v0.7.0

  • [added] Added the handshake::http module and example usage at examples/hyper_server.rs to make using Soketto in conjunction with libraries that use the http types (like Hyper) simpler #45 #48
  • [added] Allow setting custom headers on the client to be sent to WebSocket servers when the opening handshake is performed #47
Changelog

Sourced from soketto's changelog.

0.7.0

  • [added] Added the handshake::http module and example usage at examples/hyper_server.rs to make using Soketto in conjunction with libraries that use the http types (like Hyper) simpler #45 #48
  • [added] Allow setting custom headers on the client to be sent to WebSocket servers when the opening handshake is performed #47

0.6.0

  • [changed] Expose the Origin headers from the client handshake on ClientRequest #35
  • [changed] Update handshake error to expose a couple of new variants (IncompleteHttpRequest and SecWebSocketKeyInvalidLength) #35
  • [added] Add send_text_owned method to Sender as an optimisation when you can pass an owned String in #36
  • [updated] Run rustfmt over the repository, and minor tidy up #41

0.5.0

  • Update examples to Tokio 1 #27
  • Update deps and remove unnecessary transients #30
  • Add CLOSE reason handling #31
  • Fix handshake with case-sensible servers #32

0.4.2

  • Added connection ID to log output (#21).
  • Added ClientRequest::path to access the path requested by the client (See #23 by @​mward for details).
  • Updated sha-1 dependency to 0.9 (#24).

0.4.1

  • Update some dev-dependencies.

0.4.0

  • Remove all unsafe code blocks.
  • Remove internal use of futures::io::BufWriter.
  • Extension::decode now takes a &mut Vec<u8> instead of a BytesMut.
  • Incoming::Pong contains the PONG payload data slice inline.
  • Data not longer contains application data, but reports only the number of bytes. The actual data is written directly into the &mut Vec<u8> parameter of Receiver::receive or Receiver::receive_data.
  • Receiver::into_stream has been removed.

0.3.2

  • Bugfix release. Codec::encode_header contained a hidden assumption that a usize would be 8 bytes long, which is obviously only true on 64-bit architectures. See #18 for details.

0.3.1

  • A method into_inner to get back the socket has been added to

... (truncated)

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [soketto](https://github.com/paritytech/soketto) to permit the latest version.
- [Release notes](https://github.com/paritytech/soketto/releases)
- [Changelog](https://github.com/paritytech/soketto/blob/develop/CHANGELOG.md)
- [Commits](paritytech/soketto@v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: soketto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Sep 30, 2021
dvdplm
dvdplm previously approved these changes Sep 30, 2021
@dvdplm dvdplm dismissed their stale review September 30, 2021 13:09

tests should pass first

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.

One q, otherwise lgtm. (arrayvec would be a dependency soon enough so that part is fine)

Comment on lines +239 to +245
let mut headers: ArrayVec<Header, 1> = ArrayVec::new();

if let Some(origin) = self.origin_header.as_ref() {
client.set_origin(origin);
headers.push(Header { name: "Origin", value: origin.as_bytes() });
}

client.set_headers(&headers);
Copy link
Contributor

Choose a reason for hiding this comment

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

dq: why not do all this inside the if let Some(origin)… clause?

Copy link
Contributor

@maciejhirsz maciejhirsz Oct 1, 2021

Choose a reason for hiding this comment

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

headers have to be defined outside of the if block to satisfy lifetimes, and it seemed more natural to me to set headers on the same scope they are defined.

Copy link
Member

@niklasad1 niklasad1 Oct 4, 2021

Choose a reason for hiding this comment

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

@maciejhirsz I did it slightly different in #397 but this is quite neat not re-export Header from this library but I did it with an array instead. So not sure why ArrayVec dep is needed but maybe I did some refactoring with the redirect loop to make it work not sure.

let origin = self.origin_header.map(|o| [o]);
let client = some_code();
if let Some(o) = origin {
   client.set_headers(o);
}
...

Copy link
Member

@niklasad1 niklasad1 Oct 5, 2021

Choose a reason for hiding this comment

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

ah I see now, origin is borrowed in the header and ☝️ won't work.

@niklasad1 niklasad1 merged commit 92a38c9 into master Oct 5, 2021
@niklasad1 niklasad1 deleted the dependabot/cargo/soketto-0.7 branch October 5, 2021 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants