profile
viewpoint
Jacob Rothstein jbr technologist for hire pdx https://jbr.me

http-rs/tide 2605

Fast and friendly HTTP server framework for async Rust

async-rs/duplexify 42

Combine a reader + writer into a duplex of Read + Write

jbr/argonaut 17

Lightweight JSON builder for Rails

http-rs/tide-rustls 8

tls listener for tide based on async-tls and rustls

jbr/driftwood 8

some logs on the tide

jbr/breakglass 5

In case of emergency...

jbr/dbplot 5

SQL-like query in, PDF out (with R, ggplot2, and ruby)

aza/nightsky 1

The Night Sky Through A Rift

PR opened http-rs/http-types

Several missing MIME type extension detections
+4 -0

0 comment

1 changed file

pr created time in an hour

created repositoryotrego/go-type1

TeX fonts for the board game Go (Baduk, WeiQi)

created time in 4 hours

startedprisma/prisma

started time in 17 hours

issue commenthttp-rs/tide

Logging outputs invalid JSON

Oh, you are right, json_env_logger also doesn't do this correctly anymore. I forgot about that since I had to re-write that logger for internal use anyways (we wanted different field names).

For now you could pin a git dependency on my branch or use [patch-crates.io] in Cargo.toml to do so.

edmellum

comment created time in a day

Pull request review commenthttp-rs/http-types

make it so upgrade connections can be built from the outside

 pub struct RawConnection<Inner> {     inner: Inner,

If Connection is RawConnection<Box<dyn T>> anyways, why isn't inner just directlyBox<dyn T>`?

jbr

comment created time in a day

Pull request review commenthttp-rs/async-h1

Upgrades

 where             }         }; +        let upgrade_requested = match (req.header(UPGRADE), req.header(CONNECTION)) {+            (Some(_), Some(upgrade)) if upgrade.as_str().eq_ignore_ascii_case("upgrade") => true,+            _ => false,+        };+         let method = req.method();+         // Pass the request to the endpoint and encode the response.-        let res = endpoint(req).await?;+        let mut res = endpoint(req).await?;++        let upgrade_provided = res.status() == StatusCode::SwitchingProtocols && res.has_upgrade();

is res.has_upgrade() done automatically for default endpoints?

jbr

comment created time in a day

Pull request review commenthttp-rs/async-h1

Upgrades

 where             }         }; +        let upgrade_requested = match (req.header(UPGRADE), req.header(CONNECTION)) {+            (Some(_), Some(upgrade)) if upgrade.as_str().eq_ignore_ascii_case("upgrade") => true,

Some(upgrade) would probably be clear as Some(connection)

jbr

comment created time in a day

issue commenthttp-rs/tide

Logging outputs invalid JSON

I tried using json_env_logger and method and duration are still unquoted. Almost seems like neither femme nor json_env_logger supports extra fields without manually adding quotes. I haven't really kept up with structured logging in Rust, is the new interface breaking all the structured logging libraries? Am I just confused or do both libraries need the same fix you've proposed in femme? 😄

I realize I'm getting a little off track for this issue, but I'm thinking it might be useful to people in my shoes googling around. If you feel this discussion doesn't fit this issue, just delete it. I really appreciate Tide, your help and the fix for femme! 😄

edmellum

comment created time in a day

issue openedhttp-rs/http-types

Fix Typed Headers to be consistent

As discovered in https://github.com/http-rs/http-types/pull/285:

This also uncovers some unpleasantness with the current typed headers - not all of the implement the same methods, one mutates in .value(), some return String or Result<String> instead of HeaderValue, one didn't implement name() either.

Even if we don't make it a trait the consistency should be fixed in 3.0, but we should probably decide on the trait or-not before doing that work.

created time in a day

PR opened http-rs/http-types

feat: impl ToHeader for all typed headers

This adds a to_header(self) -> Result<(HeaderName, HeaderValue)> for every Typed header, as well as anything that can TryInto a (HeaderName, HeaderValue) pair.

This should make typed headers nice to use with builds such as Surf's RequestBuilder, where .header(name, value) could be changed to .header(ToHeader) and also still work with a raw tuple.


I'm not 100% happy with this though - notably to have atrait like this either we need it to be consuming (i.e. consume a typed header) or it has to clone if a tuple is passed.


This also uncovers some unpleasantness with the current typed headers - not all of the implement the same methods, one mutates in .value(), some return String or Result<String> instead of HeaderValue, one didn't implement name() either.

I think we should probably consider rolling that all into a trait.

+218 -11

0 comment

28 changed files

pr created time in a day

push eventhttp-rs/http-types

Ross MacArthur

commit sha 858f816898fd0025dce357bf0678a31e09aa59cf

Add `BasicAuth::from_credentials`

view details

Yoshua Wuyts

commit sha 2a89da2a50720ad7ff076ad1ff601051fe532fd2

Merge pull request #284 from rossmacarthur/ft/basic-auth-from-credentials Add `BasicAuth::from_credentials`

view details

push time in a day

PR merged http-rs/http-types

Add `BasicAuth::from_credentials`

If you already have an Authorization instance this allows you to construct a BasicAuth using it without parsing an Authorization from the headers again.

+6 -2

0 comment

1 changed file

rossmacarthur

pr closed time in a day

push eventhttp-rs/surf

Jeremiah Senkpiel

commit sha 431d70c554f0dad1393819aa6a35f15e8f409e43

docs: do not inline docs from deps that drift Inlining these docs causes them to be perpetually out-of-date, since Docs.rs only builds on the actual containing crate publish.

view details

Jeremiah Senkpiel

commit sha 17d91d2b01e655bdd0475cdf283437499bc6f446

Merge pull request #269 from Fishrock123/live-http-types-docs docs: do not inline docs from deps that drift

view details

push time in a day

PR merged http-rs/surf

docs: do not inline docs from deps that drift

Inlining these docs causes them to be perpetually out-of-date, since Docs.rs only builds on the actual containing crate publish.

+0 -2

0 comment

1 changed file

Fishrock123

pr closed time in a day

push eventhttp-rs/http-client

Jacob Rothstein

commit sha 5088b69a86d4d30dedadf3e824b986ff7b8eb5be

fix a mistake in the Box<dyn HttpClient> implementation

view details

Jeremiah Senkpiel

commit sha 352ad272d03a730a5b3dcc336d262fe59ea29bd6

Merge pull request #52 from jbr/fix-box-dyn-recursion fix a mistake in the Box<dyn HttpClient> implementation

view details

push time in a day

PR merged http-rs/http-client

fix a mistake in the Box<dyn HttpClient> implementation

without the .as_ref(), it recursed infinitely because self is the Box, not the dyn HttpClient 🤦

+1 -1

0 comment

1 changed file

jbr

pr closed time in a day

delete branch jbr/longboard

delete branch : dependabot/cargo/bat-0.17.0

delete time in 2 days

PR closed jbr/longboard

Bump bat from 0.16.0 to 0.17.0 dependencies

Bumps bat from 0.16.0 to 0.17.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/sharkdp/bat/releases">bat's releases</a>.</em></p> <blockquote> <h2>v0.17.0</h2> <h2>Features</h2> <ul> <li>Added a new <code>--style</code> value, <code>rule</code>, which adds a simple horizontal ruled line between files, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1276">#1276</a> (<a href="https://github.com/tommilligan">@tommilligan</a>)</li> <li>Pass <code>-S</code> ("chop long lines") to <code>less</code> if <code>--wrap=never</code> is set in <code>bat</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1255">#1255</a> (<a href="https://github.com/gahag">@gahag</a>)</li> </ul> <h2>Bugfixes</h2> <ul> <li>Detect infinite loop when input and output are the same, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1193">#1193</a> and <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1197">#1197</a> (<a href="https://github.com/niklasmohrin">@niklasmohrin</a>)</li> <li>Throw an error when <code>bat</code> is being used as <code>pager</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1343">#1343</a> (<a href="https://github.com/adrian-rivera">@adrian-rivera</a>)</li> <li>Bash syntax highlighting not selected for <code>.ebuild</code> and <code>.eclass</code> files, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1292">#1292</a> (<a href="https://github.com/sharkdp">@sharkdp</a>)</li> <li>Fix <code>zsh</code> completion when using <code>-p</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1320">#1320</a> (<a href="https://github.com/xzfc">@xzfc</a>)</li> </ul> <h2>Other</h2> <ul> <li>Add note to refer to see detailed help with <code>--help</code> (and vice versa with <code>-h</code>), see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1215">#1215</a> (<a href="https://github.com/henil">@henil</a>)</li> <li>Add a <code>Contributors</code> section to <code>README</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1348">#1348</a> (<a href="https://github.com/adrian-rivera">@adrian-rivera</a>)</li> </ul> <h2>Syntaxes</h2> <ul> <li>Manpage syntax highlighting has been improved, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1315">#1315</a> (<a href="https://github.com/keith-hall">@keith-hall</a>)</li> <li>Add Svelte file syntax, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1285">#1285</a> (<a href="https://github.com/kjmph">@kjmph</a>)</li> </ul> <h2>New themes</h2> <ul> <li>Coldark, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1329">#1329</a> (<a href="https://github.com/armandphilippot">@armandphilippot</a>)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/sharkdp/bat/blob/master/CHANGELOG.md">bat's changelog</a>.</em></p> <blockquote> <h1>v0.17.0</h1> <h2>Features</h2> <ul> <li>Added a new <code>--style</code> value, <code>rule</code>, which adds a simple horizontal ruled line between files, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1276">#1276</a> (<a href="https://github.com/tommilligan">@tommilligan</a>)</li> <li>Pass <code>-S</code> ("chop long lines") to <code>less</code> if <code>--wrap=never</code> is set in <code>bat</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1255">#1255</a> (<a href="https://github.com/gahag">@gahag</a>)</li> </ul> <h2>Bugfixes</h2> <ul> <li>Detect infinite loop when input and output are the same, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1193">#1193</a> and <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1197">#1197</a> (<a href="https://github.com/niklasmohrin">@niklasmohrin</a>)</li> <li>Throw an error when <code>bat</code> is being used as <code>pager</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1343">#1343</a> (<a href="https://github.com/adrian-rivera">@adrian-rivera</a>)</li> <li>Bash syntax highlighting not selected for <code>.ebuild</code> and <code>.eclass</code> files, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1292">#1292</a> (<a href="https://github.com/sharkdp">@sharkdp</a>)</li> <li>Fix <code>zsh</code> completion when using <code>-p</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1320">#1320</a> (<a href="https://github.com/xzfc">@xzfc</a>)</li> </ul> <h2>Other</h2> <ul> <li>Add note to refer to see detailed help with <code>--help</code> (and vice versa with <code>-h</code>), see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1215">#1215</a> (<a href="https://github.com/henil">@henil</a>)</li> <li>Add a <code>Contributors</code> section to <code>README</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1348">#1348</a> (<a href="https://github.com/adrian-rivera">@adrian-rivera</a>)</li> </ul> <h2>Syntaxes</h2> <ul> <li>Manpage syntax highlighting has been improved, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1315">#1315</a> (<a href="https://github.com/keith-hall">@keith-hall</a>)</li> <li>Add Svelte file syntax, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1285">#1285</a> (<a href="https://github.com/kjmph">@kjmph</a>)</li> </ul> <h2>New themes</h2> <ul> <li>Coldark, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1329">#1329</a> (<a href="https://github.com/armandphilippot">@armandphilippot</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/sharkdp/bat/commit/591eba66a3af1c211a09eefd17cbeb819b0a131f"><code>591eba6</code></a> add new syntax test files</li> <li><a href="https://github.com/sharkdp/bat/commit/a5a9ac83e5a506ac2bdc673476aca54c818eabe2"><code>a5a9ac8</code></a> Revert "Update dependencies"</li> <li><a href="https://github.com/sharkdp/bat/commit/15b122a448955391e61011344a2cca9f2c89b891"><code>15b122a</code></a> Update syntax cache</li> <li><a href="https://github.com/sharkdp/bat/commit/44a905d1358fff573fe59ec43be8b15df19fd768"><code>44a905d</code></a> Update dependencies</li> <li><a href="https://github.com/sharkdp/bat/commit/8884104e828a2abebf19ab42837527d38e924f83"><code>8884104</code></a> Bump version to v0.17.0</li> <li><a href="https://github.com/sharkdp/bat/commit/277cc5fa2120e3801c4cf2df2d0be08a8c9effd3"><code>277cc5f</code></a> Revert "invoke gzip with -n"</li> <li><a href="https://github.com/sharkdp/bat/commit/0cbd7d583c49d1629bde72fe6afb1abf8065f1f5"><code>0cbd7d5</code></a> Revert "remove leading article from description"</li> <li><a href="https://github.com/sharkdp/bat/commit/3c3fc92863ad93748f703bcbaa141bd9fe4acdb6"><code>3c3fc92</code></a> Revert "ensure copyright is mode 644"</li> <li><a href="https://github.com/sharkdp/bat/commit/e69d65059838a6c0827798c9e0dff701329c8918"><code>e69d650</code></a> Revert "include years in copyright notice"</li> <li><a href="https://github.com/sharkdp/bat/commit/9385c81882cefbca714f1b8431631a8ac6784200"><code>9385c81</code></a> Revert "include changelog in package"</li> <li>Additional commits viewable in <a href="https://github.com/sharkdp/bat/compare/v0.16.0...v0.17.0">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

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.


<details> <summary>Dependabot commands and options</summary> <br />

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)

</details>

+29 -15

1 comment

2 changed files

dependabot[bot]

pr closed time in 2 days

pull request commentjbr/longboard

Bump bat from 0.16.0 to 0.17.0

Superseded by #4.

dependabot[bot]

comment created time in 2 days

PR opened jbr/longboard

Bump bat from 0.16.0 to 0.17.1

Bumps bat from 0.16.0 to 0.17.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/sharkdp/bat/releases">bat's releases</a>.</em></p> <blockquote> <h2>v0.17.1</h2> <h2>Bugfixes</h2> <ul> <li>Running <code>bat</code> without arguments fails ("output file is also an input"), see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1396">#1396</a></li> </ul> <h2>v0.17.0</h2> <h2>Features</h2> <ul> <li>Added a new <code>--style</code> value, <code>rule</code>, which adds a simple horizontal ruled line between files, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1276">#1276</a> (<a href="https://github.com/tommilligan">@tommilligan</a>)</li> <li>Pass <code>-S</code> ("chop long lines") to <code>less</code> if <code>--wrap=never</code> is set in <code>bat</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1255">#1255</a> (<a href="https://github.com/gahag">@gahag</a>)</li> </ul> <h2>Bugfixes</h2> <ul> <li>Detect infinite loop when input and output are the same, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1193">#1193</a> and <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1197">#1197</a> (<a href="https://github.com/niklasmohrin">@niklasmohrin</a>)</li> <li>Throw an error when <code>bat</code> is being used as <code>pager</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1343">#1343</a> (<a href="https://github.com/adrian-rivera">@adrian-rivera</a>)</li> <li>Bash syntax highlighting not selected for <code>.ebuild</code> and <code>.eclass</code> files, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1292">#1292</a> (<a href="https://github.com/sharkdp">@sharkdp</a>)</li> <li>Fix <code>zsh</code> completion when using <code>-p</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1320">#1320</a> (<a href="https://github.com/xzfc">@xzfc</a>)</li> </ul> <h2>Other</h2> <ul> <li>Add note to refer to see detailed help with <code>--help</code> (and vice versa with <code>-h</code>), see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1215">#1215</a> (<a href="https://github.com/henil">@henil</a>)</li> <li>Add a <code>Contributors</code> section to <code>README</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1348">#1348</a> (<a href="https://github.com/adrian-rivera">@adrian-rivera</a>)</li> </ul> <h2>Syntaxes</h2> <ul> <li>Manpage syntax highlighting has been improved, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1315">#1315</a> (<a href="https://github.com/keith-hall">@keith-hall</a>)</li> <li>Add Svelte file syntax, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1285">#1285</a> (<a href="https://github.com/kjmph">@kjmph</a>)</li> </ul> <h2>New themes</h2> <ul> <li>Coldark, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1329">#1329</a> (<a href="https://github.com/armandphilippot">@armandphilippot</a>)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/sharkdp/bat/blob/master/CHANGELOG.md">bat's changelog</a>.</em></p> <blockquote> <h1>v0.17.1</h1> <h2>Bugfixes</h2> <ul> <li>Running <code>bat</code> without arguments fails ("output file is also an input"), see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1396">#1396</a></li> </ul> <h1>v0.17.0</h1> <h2>Features</h2> <ul> <li>Added a new <code>--style</code> value, <code>rule</code>, which adds a simple horizontal ruled line between files, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1276">#1276</a> (<a href="https://github.com/tommilligan">@tommilligan</a>)</li> <li>Pass <code>-S</code> ("chop long lines") to <code>less</code> if <code>--wrap=never</code> is set in <code>bat</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1255">#1255</a> (<a href="https://github.com/gahag">@gahag</a>)</li> </ul> <h2>Bugfixes</h2> <ul> <li>Detect infinite loop when input and output are the same, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1193">#1193</a> and <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1197">#1197</a> (<a href="https://github.com/niklasmohrin">@niklasmohrin</a>)</li> <li>Throw an error when <code>bat</code> is being used as <code>pager</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1343">#1343</a> (<a href="https://github.com/adrian-rivera">@adrian-rivera</a>)</li> <li>Bash syntax highlighting not selected for <code>.ebuild</code> and <code>.eclass</code> files, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1292">#1292</a> (<a href="https://github.com/sharkdp">@sharkdp</a>)</li> <li>Fix <code>zsh</code> completion when using <code>-p</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1320">#1320</a> (<a href="https://github.com/xzfc">@xzfc</a>)</li> </ul> <h2>Other</h2> <ul> <li>Add note to refer to see detailed help with <code>--help</code> (and vice versa with <code>-h</code>), see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1215">#1215</a> (<a href="https://github.com/henil">@henil</a>)</li> <li>Add a <code>Contributors</code> section to <code>README</code>, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1348">#1348</a> (<a href="https://github.com/adrian-rivera">@adrian-rivera</a>)</li> </ul> <h2>Syntaxes</h2> <ul> <li>Manpage syntax highlighting has been improved, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1315">#1315</a> (<a href="https://github.com/keith-hall">@keith-hall</a>)</li> <li>Add Svelte file syntax, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1285">#1285</a> (<a href="https://github.com/kjmph">@kjmph</a>)</li> </ul> <h2>New themes</h2> <ul> <li>Coldark, see <a href="https://github-redirect.dependabot.com/sharkdp/bat/issues/1329">#1329</a> (<a href="https://github.com/armandphilippot">@armandphilippot</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/sharkdp/bat/commit/6d981498d80aa0127df9547ec0ac69d8314b29e5"><code>6d98149</code></a> Bump version to 0.17.1</li> <li><a href="https://github.com/sharkdp/bat/commit/bd2e9917da5cf5b4f7bae48ef5b97ce5cead2803"><code>bd2e991</code></a> Revert "Add cycle detection integration tests"</li> <li><a href="https://github.com/sharkdp/bat/commit/a6810e3353db8536015b830b28e45e5e0167fdac"><code>a6810e3</code></a> Revert "Add io cycle detection with clircle"</li> <li><a href="https://github.com/sharkdp/bat/commit/591eba66a3af1c211a09eefd17cbeb819b0a131f"><code>591eba6</code></a> add new syntax test files</li> <li><a href="https://github.com/sharkdp/bat/commit/a5a9ac83e5a506ac2bdc673476aca54c818eabe2"><code>a5a9ac8</code></a> Revert "Update dependencies"</li> <li><a href="https://github.com/sharkdp/bat/commit/15b122a448955391e61011344a2cca9f2c89b891"><code>15b122a</code></a> Update syntax cache</li> <li><a href="https://github.com/sharkdp/bat/commit/44a905d1358fff573fe59ec43be8b15df19fd768"><code>44a905d</code></a> Update dependencies</li> <li><a href="https://github.com/sharkdp/bat/commit/8884104e828a2abebf19ab42837527d38e924f83"><code>8884104</code></a> Bump version to v0.17.0</li> <li><a href="https://github.com/sharkdp/bat/commit/277cc5fa2120e3801c4cf2df2d0be08a8c9effd3"><code>277cc5f</code></a> Revert "invoke gzip with -n"</li> <li><a href="https://github.com/sharkdp/bat/commit/0cbd7d583c49d1629bde72fe6afb1abf8065f1f5"><code>0cbd7d5</code></a> Revert "remove leading article from description"</li> <li>Additional commits viewable in <a href="https://github.com/sharkdp/bat/compare/v0.16.0...v0.17.1">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

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.


<details> <summary>Dependabot commands and options</summary> <br />

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)

</details>

+5 -15

0 comment

2 changed files

pr created time in 2 days

create barnchjbr/longboard

branch : dependabot/cargo/bat-0.17.1

created branch time in 2 days

pull request commenthttp-rs/tide

Serve content with support for HTTP conditionals and range requests

This is indeed an open question. It could be renamed in something like http_types::conditional::CondState, or a better name that suite more HTTP wording. But personally I am more on the it would be confusing side: I believe the ModState is closer to the application logic, than HTTP logic (the border is thin). It is just a convenient utility provided to the user to pass either a time or a version string associated to its resource.

I might change my opinion here. When you look at the If-Range header implementation I have submitted in http-rs/http-types#180 it has exactly the same need. Having a shared type to handle both cases might be interesting, and in such case it would belong to http-types utils.

ririsoft

comment created time in 2 days

Pull request review commenthttp-rs/http-types

New range request module

+use crate::headers::{HeaderName, HeaderValue, Headers, ToHeaderValues, RANGE};+use crate::range::ByteRange;+use crate::{Error, StatusCode};++use std::fmt::{self, Debug, Display};+use std::option;+use std::str::FromStr;++/// HTTP Range requests with bytes unit.+///+/// Range header in a GET request modifies the method+/// semantics to request transfer of only one or more subranges of the+/// selected representation data, rather than the entire selected+/// representation data.+///+/// # Specifications+///+/// - [RFC 7233, section 3.1: Range](https://tools.ietf.org/html/rfc7233#section-3.1)+/// - [RFC 7233, Appendix D: Collected ABNF](https://tools.ietf.org/html/rfc7233#appendix-D)+/// - [IANA HTTP parameters, range-units: HTTP Range Unit Registry](https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#range-units)+///+/// # Examples+///+/// Raw Range header parsing:+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::{ByteRange, ByteRanges};+/// use http_types::{Method, Request, Url};+///+/// let mut ranges = ByteRanges::new();+/// ranges.push(0, 500);+///+/// let mut req = Request::new(Method::Get, Url::parse("http://example.com").unwrap());+/// ranges.apply(&mut req);+///+/// let ranges = ByteRanges::from_headers(req)?.unwrap();+/// assert_eq!(ranges.first().unwrap(), ByteRange::new(0, 500));+/// #+/// # Ok(()) }+/// ```+///+/// Most of the time applications want to validate the range set against+/// the actual size of the document, as per the RFC specification:+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::{ByteRange, ByteRanges};+/// use http_types::{Method, Request, StatusCode, Url};+/// use std::convert::TryInto;+///+/// let mut ranges = ByteRanges::new();+/// ranges.push(0, 500);+///+/// let mut req = Request::new(Method::Get, Url::parse("http://example.com").unwrap());+/// ranges.apply(&mut req);+///+/// let ranges = ByteRanges::from_headers(req)?.unwrap();+/// assert_eq!(ranges.first().unwrap(), ByteRange::new(0, 500));+///+/// let err = ranges.match_size(350).unwrap_err();+/// assert_eq!(err.status(), StatusCode::RequestedRangeNotSatisfiable);+/// #+/// # Ok(()) }+/// ```+#[derive(Default, Debug, Clone, Eq, PartialEq)]+pub struct ByteRanges {+    ranges: Vec<ByteRange>,+}++impl ByteRanges {+    const RANGE_PREFIX: &'static str = "bytes=";++    /// Create a new instance with an empty range set.+    pub fn new() -> Self {+        ByteRanges::default()+    }++    /// Pushes a new byte range at the end of the byte range set.+    pub fn push<S, E>(&mut self, start: S, end: E)+    where+        S: Into<Option<u64>>,+        E: Into<Option<u64>>,+    {+        let range = ByteRange::new(start, end);+        self.ranges.push(range);+    }++    /// Returns an `Iterator` over the byte ranges.+    pub fn iter(&self) -> impl Iterator<Item = &ByteRange> {+        self.ranges.iter()+    }++    /// Returns the first byte range in the byte ranges set.+    pub fn first(&self) -> Option<ByteRange> {+        self.ranges.get(0).copied()+    }++    /// Validates that the ranges are withing the expected document size.

Typo: within

ririsoft

comment created time in 2 days

Pull request review commenthttp-rs/http-types

New range request module

+use crate::headers::{HeaderName, HeaderValue, Headers, ToHeaderValues, CONTENT_RANGE};+use crate::range::ByteRange;+use crate::{Error, StatusCode};++use std::fmt::{self, Debug, Display};+use std::option;+use std::str::FromStr;++/// HTTP ContentRange response header with bytes unit.+///+/// The "Content-Range" header field is sent in a single part 206+/// (Partial Content) response to indicate the partial range of the+/// selected representation enclosed as the message payload, sent in each+/// part of a multipart 206 response to indicate the range enclosed+/// within each body part, and sent in 416 (Range Not Satisfiable)+/// responses to provide information about the selected representation.+///+/// # Specifications+///+/// - [RFC 7233, section 4.2: Range](https://tools.ietf.org/html/rfc7233#section-4.2)+///+/// # Examples+///+/// Encoding a Content-Range header for byte range 1-5 of a 10 bytes size document:+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::{ByteContentRange, ByteRange};+/// use http_types::{Response, StatusCode};+///+/// let mut content_range = ByteContentRange::new().with_range(1, 5).with_size(10);+///+/// let mut res = Response::new(StatusCode::PartialContent);+/// content_range.apply(&mut res);+///+/// let content_range = ByteContentRange::from_headers(res)?.unwrap();+/// assert_eq!(content_range.range(), Some(ByteRange::new(1, 5)));+/// assert_eq!(content_range.size(), Some(10));+/// #+/// # Ok(()) }+/// ```+///+/// Encoding a Content-Range header for byte range 1-5 with unknown size:+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::{ByteContentRange, ByteRange};+/// use http_types::{Response, StatusCode};+///+/// let mut content_range = ByteContentRange::new().with_range(1, 5);+///+/// let mut res = Response::new(StatusCode::PartialContent);+/// content_range.apply(&mut res);+///+/// let content_range = ByteContentRange::from_headers(res)?.unwrap();+/// assert_eq!(content_range.range(), Some(ByteRange::new(1, 5)));+/// assert_eq!(content_range.size(), None);+/// #+/// # Ok(()) }+/// ```+///+/// Responding to an invalid range request for a 10 bytes document:+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::{ByteContentRange, ByteRange};+/// use http_types::{Response, StatusCode};+///+/// let mut content_range = ByteContentRange::new().with_size(10);+///+/// let mut res = Response::new(StatusCode::RequestedRangeNotSatisfiable);+/// content_range.apply(&mut res);+///+/// let content_range = ByteContentRange::from_headers(res)?.unwrap();+/// assert_eq!(content_range.range(), None);+/// assert_eq!(content_range.size(), Some(10));+/// #+/// # Ok(()) }+/// ```+#[derive(Default, Debug, Clone, Eq, PartialEq)]+pub struct ByteContentRange {+    size: Option<u64>,+    range: Option<ByteRange>,+}++impl ByteContentRange {+    const CONTENT_RANGE_PREFIX: &'static str = "bytes";++    /// Create a new instance with no range and no size.+    pub fn new() -> Self {+        ByteContentRange::default()+    }++    /// Returns a new instance with a given range defined by `start` and `end` bounds.+    pub fn with_range(mut self, start: u64, end: u64) -> Self {+        self.range = Some(ByteRange::new(start, end));+        self+    }++    /// Returns a new instance with a size.+    pub fn with_size(mut self, size: u64) -> Self {+        self.size = Some(size);+        self+    }++    /// Returns the `ByteRange` if any.+    pub fn range(&self) -> Option<ByteRange> {+        self.range+    }++    /// Returns the size if any.+    pub fn size(&self) -> Option<u64> {+        self.size+    }++    /// Create a new instance from a Content-Range headers.+    ///+    /// Only a single Content-Range per resource is assumed to exist. If multiple Range+    /// headers are found the last one is used.+    pub fn from_headers(headers: impl AsRef<Headers>) -> crate::Result<Option<Self>> {+        let headers = match headers.as_ref().get(CONTENT_RANGE) {+            Some(headers) => headers,+            None => return Ok(None),+        };++        // If a header is returned we can assume at least one exists.+        let s = headers.iter().last().unwrap().as_str();+        if !s.starts_with(Self::CONTENT_RANGE_PREFIX) {+            return Ok(None);+        }+        Self::from_str(s).map(Some)+    }++    /// Create a ByteRanges from a string.+    pub(crate) fn from_str(s: &str) -> crate::Result<Self> {+        let fn_err = || {

There is no error code specified for invalid Content-Range header in a response. I chose to use the error the same error code as the one used for bad range requests.

ririsoft

comment created time in 2 days

Pull request review commenthttp-rs/http-types

New range request module

+use crate::headers::{HeaderName, HeaderValue, Headers, ToHeaderValues, ACCEPT_RANGES};++use std::fmt::{self, Debug, Display};+use std::option;++/// HTTP Accept-Ranges+///+/// Accept-Ranges header indicates that the server supports+/// range requests and specifies the unit to be used by+/// clients for range requests.+///+/// The default value is to not accept range requests.+///+/// # Specifications+///+/// - [RFC 7233, section 2.3: Accept-Ranges](https://tools.ietf.org/html/rfc7233#section-2.3)+/// - [RFC 7233, section 2.1: Byte Ranges](https://tools.ietf.org/html/rfc7233#section-2.1)+/// - [IANA HTTP parameters, range-units: HTTP Range Unit Registry](https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#range-units)+///+/// # Examples+///+/// Accepting ranges specified in byte unit (the widely used default):+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::AcceptRanges;+/// use http_types::Response;+///+/// let accept_ranges = AcceptRanges::with_bytes();+///+/// let mut res = Response::new(200);+/// accept_ranges.apply(&mut res);+///+/// let accept_ranges = AcceptRanges::from_headers(res)?.unwrap();+/// assert_eq!(accept_ranges.bytes(), true);+/// #+/// # Ok(()) }+/// ```+///+/// Other unit ranges:+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::AcceptRanges;+/// use http_types::Response;+///+/// let custom_type = String::from("my_custom_type");+/// let accept_ranges = AcceptRanges::with_other(custom_type.clone());+///+/// let mut res = Response::new(200);+/// accept_ranges.apply(&mut res);+///+/// let accept_ranges = AcceptRanges::from_headers(res)?.unwrap();+/// assert_eq!(accept_ranges.other(), &Some(custom_type));+/// #+/// # Ok(()) }+/// ```+///+/// Range requests not accepted:+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::AcceptRanges;+/// use http_types::Response;+///+/// let accept_ranges = AcceptRanges::new();+///+/// let mut res = Response::new(200);+/// accept_ranges.apply(&mut res);+///+/// let accept_ranges = AcceptRanges::from_headers(res)?.unwrap();+/// assert_eq!(accept_ranges.bytes(), false);+/// assert_eq!(accept_ranges.other(), &None);+/// #+/// # Ok(()) }+/// ```+#[derive(Default, Debug, Clone, Eq, PartialEq)]+pub struct AcceptRanges {+    bytes: bool,+    other: Option<String>,+}++impl AcceptRanges {+    const BYTES: &'static str = "bytes";+    const NONE: &'static str = "none";++    /// Create a new AcceptRange which does not accept range requests.+    pub fn new() -> Self {+        Self::default()+    }++    /// Create a new AcceptRange accepting `byte` unit.+    pub fn with_bytes() -> Self {+        AcceptRanges {+            bytes: true,+            ..Default::default()+        }+    }++    /// Create a new AcceptRange accepting `byte` unit.+    pub fn with_other(s: impl AsRef<str>) -> Self {+        AcceptRanges {+            other: Some(s.as_ref().to_owned()),+            ..Default::default()+        }+    }++    /// Returns true if AcceptRange accepts `byte` unit.+    pub fn bytes(&self) -> bool {+        self.bytes+    }++    /// Returns the supported unit if any.+    pub fn other(&self) -> &Option<String> {+        &self.other+    }++    /// Create a new instance from headers.+    ///+    /// Only a single AcceptRanges per resource is assumed to exist. If multiple Accept-Ranges+    /// headers are found the last one is used.+    pub fn from_headers(headers: impl AsRef<Headers>) -> crate::Result<Option<Self>> {+        let headers = match headers.as_ref().get(ACCEPT_RANGES) {+            Some(headers) => headers,+            None => return Ok(None),+        };++        // If a header is returned we can assume at least one exists.+        let s = headers.iter().last().unwrap().as_str();+        Self::from_str(s).map(Some)+    }++    /// Create an AcceptRanges from a string.+    pub(crate) fn from_str(s: &str) -> crate::Result<Self> {+        let accept_range = match s {+            Self::NONE => AcceptRanges::default(),+            Self::BYTES => AcceptRanges::with_bytes(),+            other => AcceptRanges::with_other(other),+        };+        Ok(accept_range)+    }++    /// Sets the `Accept-Ranges` header.+    pub fn apply(&self, mut headers: impl AsMut<Headers>) {+        headers.as_mut().insert(ACCEPT_RANGES, self.value());+    }++    /// Get the `HeaderName`.+    pub fn name(&self) -> HeaderName {+        ACCEPT_RANGES+    }++    /// Get the `HeaderValue`.+    pub fn value(&self) -> HeaderValue {+        let s = match self.other {+            Some(ref other) => other.as_str(),+            None if self.bytes => Self::BYTES,+            None => Self::NONE,+        };

This could be factorized with the Display implementation. Let me known if you want that.

ririsoft

comment created time in 2 days

Pull request review commenthttp-rs/http-types

New range request module

+use crate::headers::{HeaderName, HeaderValue, Headers, ToHeaderValues, ACCEPT_RANGES};++use std::fmt::{self, Debug, Display};+use std::option;++/// HTTP Accept-Ranges+///+/// Accept-Ranges header indicates that the server supports+/// range requests and specifies the unit to be used by+/// clients for range requests.+///+/// The default value is to not accept range requests.+///+/// # Specifications+///+/// - [RFC 7233, section 2.3: Accept-Ranges](https://tools.ietf.org/html/rfc7233#section-2.3)+/// - [RFC 7233, section 2.1: Byte Ranges](https://tools.ietf.org/html/rfc7233#section-2.1)+/// - [IANA HTTP parameters, range-units: HTTP Range Unit Registry](https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#range-units)+///+/// # Examples+///+/// Accepting ranges specified in byte unit (the widely used default):+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::AcceptRanges;+/// use http_types::Response;+///+/// let accept_ranges = AcceptRanges::with_bytes();+///+/// let mut res = Response::new(200);+/// accept_ranges.apply(&mut res);+///+/// let accept_ranges = AcceptRanges::from_headers(res)?.unwrap();+/// assert_eq!(accept_ranges.bytes(), true);+/// #+/// # Ok(()) }+/// ```+///+/// Other unit ranges:+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::AcceptRanges;+/// use http_types::Response;+///+/// let custom_type = String::from("my_custom_type");+/// let accept_ranges = AcceptRanges::with_other(custom_type.clone());+///+/// let mut res = Response::new(200);+/// accept_ranges.apply(&mut res);+///+/// let accept_ranges = AcceptRanges::from_headers(res)?.unwrap();+/// assert_eq!(accept_ranges.other(), &Some(custom_type));+/// #+/// # Ok(()) }+/// ```+///+/// Range requests not accepted:+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::AcceptRanges;+/// use http_types::Response;+///+/// let accept_ranges = AcceptRanges::new();+///+/// let mut res = Response::new(200);+/// accept_ranges.apply(&mut res);+///+/// let accept_ranges = AcceptRanges::from_headers(res)?.unwrap();+/// assert_eq!(accept_ranges.bytes(), false);+/// assert_eq!(accept_ranges.other(), &None);+/// #+/// # Ok(()) }+/// ```+#[derive(Default, Debug, Clone, Eq, PartialEq)]+pub struct AcceptRanges {+    bytes: bool,+    other: Option<String>,+}++impl AcceptRanges {+    const BYTES: &'static str = "bytes";+    const NONE: &'static str = "none";++    /// Create a new AcceptRange which does not accept range requests.+    pub fn new() -> Self {+        Self::default()+    }++    /// Create a new AcceptRange accepting `byte` unit.+    pub fn with_bytes() -> Self {+        AcceptRanges {+            bytes: true,+            ..Default::default()+        }+    }++    /// Create a new AcceptRange accepting `byte` unit.+    pub fn with_other(s: impl AsRef<str>) -> Self {+        AcceptRanges {+            other: Some(s.as_ref().to_owned()),+            ..Default::default()+        }+    }++    /// Returns true if AcceptRange accepts `byte` unit.+    pub fn bytes(&self) -> bool {+        self.bytes+    }++    /// Returns the supported unit if any.+    pub fn other(&self) -> &Option<String> {

I am not a fan of returning &Option<String>>. Maybe Option<&str> is better ?

ririsoft

comment created time in 2 days

Pull request review commenthttp-rs/http-types

New range request module

+use crate::headers::{HeaderName, HeaderValue, Headers, ToHeaderValues, ACCEPT_RANGES};++use std::fmt::{self, Debug, Display};+use std::option;++/// HTTP Accept-Ranges+///+/// Accept-Ranges header indicates that the server supports+/// range requests and specifies the unit to be used by+/// clients for range requests.+///+/// The default value is to not accept range requests.+///+/// # Specifications+///+/// - [RFC 7233, section 2.3: Accept-Ranges](https://tools.ietf.org/html/rfc7233#section-2.3)+/// - [RFC 7233, section 2.1: Byte Ranges](https://tools.ietf.org/html/rfc7233#section-2.1)+/// - [IANA HTTP parameters, range-units: HTTP Range Unit Registry](https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#range-units)+///+/// # Examples+///+/// Accepting ranges specified in byte unit (the widely used default):+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::AcceptRanges;+/// use http_types::Response;+///+/// let accept_ranges = AcceptRanges::with_bytes();+///+/// let mut res = Response::new(200);+/// accept_ranges.apply(&mut res);+///+/// let accept_ranges = AcceptRanges::from_headers(res)?.unwrap();+/// assert_eq!(accept_ranges.bytes(), true);+/// #+/// # Ok(()) }+/// ```+///+/// Other unit ranges:+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::AcceptRanges;+/// use http_types::Response;+///+/// let custom_type = String::from("my_custom_type");+/// let accept_ranges = AcceptRanges::with_other(custom_type.clone());+///+/// let mut res = Response::new(200);+/// accept_ranges.apply(&mut res);+///+/// let accept_ranges = AcceptRanges::from_headers(res)?.unwrap();+/// assert_eq!(accept_ranges.other(), &Some(custom_type));+/// #+/// # Ok(()) }+/// ```+///+/// Range requests not accepted:+///+/// ```+/// # fn main() -> http_types::Result<()> {+/// #+/// use http_types::range::AcceptRanges;+/// use http_types::Response;+///+/// let accept_ranges = AcceptRanges::new();+///+/// let mut res = Response::new(200);+/// accept_ranges.apply(&mut res);+///+/// let accept_ranges = AcceptRanges::from_headers(res)?.unwrap();+/// assert_eq!(accept_ranges.bytes(), false);+/// assert_eq!(accept_ranges.other(), &None);+/// #+/// # Ok(()) }+/// ```+#[derive(Default, Debug, Clone, Eq, PartialEq)]+pub struct AcceptRanges {+    bytes: bool,+    other: Option<String>,+}++impl AcceptRanges {+    const BYTES: &'static str = "bytes";+    const NONE: &'static str = "none";++    /// Create a new AcceptRange which does not accept range requests.+    pub fn new() -> Self {

new setting the value to "none" might be confusing here since the widely used default is "bytes". Maybe we should name it new_none or a better idea ?

ririsoft

comment created time in 2 days

push eventmtrudel/thousand_island

Mat Trudel

commit sha f63dce713797fb9dfc8ced366d313470e940dde8

Remove .travis.yml

view details

push time in 2 days

Pull request review commenthttp-rs/async-h1

new encoder for client and server

 date: {DATE}             Method::Get,             res,             r#"HTTP/1.1 200 OK-transfer-encoding: chunked-date: {DATE} content-type: application/octet-stream+date: {DATE}+transfer-encoding: chunked -1-h 5-ello +hello 5-world+ worl+1+d

ah I missed the 10 argument

jbr

comment created time in 2 days

Pull request review commenthttp-rs/async-h1

refactor tests

+mod client_decode {+    use async_h1::client;+    use async_std::io::Cursor;+    use http_types::headers;+    use http_types::Result;+    use pretty_assertions::assert_eq;++    async fn decode_str(s: &'static str) -> http_types::Result<http_types::Response> {+        client::decode(Cursor::new(s.replace("\n", "\r\n"))).await

Hmm, better, although the trailing linebreaks (and any special white space) may become less clear?

jbr

comment created time in 2 days

more