-
Notifications
You must be signed in to change notification settings - Fork 173
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
Conversation
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] <[email protected]>
There was a problem hiding this 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)
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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);
}
...
There was a problem hiding this comment.
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.
Updates the requirements on soketto to permit the latest version.
Release notes
Sourced from soketto's releases.
Changelog
Sourced from soketto's changelog.
... (truncated)
Commits
feb2204
Release v0.7.0 (#51)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)