Skip to content

Conversation

@sanmai-NL
Copy link
Contributor

And only known extensions. Clean up parsing of extensions in general.

@sanmai-NL
Copy link
Contributor Author

@seanmonstar: could you let me know when you plan to review this?

@LegNeato
Copy link

LegNeato commented Dec 6, 2017

This would be a breaking change, right? If so can you add BREAKING_CHANGE: <description> to the commit message?

@seanmonstar
Copy link
Member

Sorry, yes, this would be a breaking change, so it couldn't be part of 0.11. I'll put it in the 0.12 milestone, but if someone needs it immediately, one could just copy the code into a local module and use it instead of importing from hyper.

@seanmonstar seanmonstar added this to the 0.12 milestone Dec 6, 2017
And only known extensions. Clean up parsing of extensions in general.
BREAKING_CHANGE: breaks most uses of `CacheDirective::Extension`.
@sanmai-NL
Copy link
Contributor Author

@LegNeato, @seanmonstar: done. @seanmonstar: okay great, but when is a review planned, if any?

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

Thanks! The code looks correct! Unfortunately due to the original design of having public fields and an open enum, these are breaking changes.

If you want, we could also include a redesign of this header to make adding new extensions backwards compatible. If you want to do this, I can write out some changes I'd make on a high level...

/// Extension directives. Optionally include an argument.
Extension(String, Option<String>)
/// Extension directives.
Extension(CacheDirectiveExtension),
Copy link
Member

Choose a reason for hiding this comment

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

The original goal of the Extension variant was to allow for new arguments even if the version of hyper doesn't support them (hence being just Strings). Would it make sense for these new variants to just be on CacheDirective itself?

@seanmonstar seanmonstar removed this from the 0.12 milestone Feb 21, 2018
@seanmonstar
Copy link
Member

As noted in #189, headers are actually going to moved out of hyper proper. So as to not keep this dangling, I'm going to close this. Thanks for the submission, and of course, because the header system works for anything that implements Header, anyone can use these changes themselves by creating a new type.

@sanmai-NL
Copy link
Contributor Author

sanmai-NL commented Feb 22, 2018

@seanmonstar: would it be okay to merge this PR, for the time being? Nobody is going to look up a stale PR branch to reuse any of this work, so it’d be a waste. Even if you plan to release the redesigned hyper version soon, then at least I could pin hyper to an older version that still has the header module, along with this enhancement.

@sfackler
Copy link
Contributor

Is there any particular reason you need to pull the header from the Hyper crate specifically?

@sanmai-NL
Copy link
Contributor Author

sanmai-NL commented Feb 22, 2018

No there isn’t. I was under the impression that the new headers crate will not be API-compatible with the old module. Apart from that, I assumed that the starting point in terms of headers to reimplement would be the original Hyper headers module, and so that it would matter for everyone whether this PR gets merged or is left depending on further initiative.

@seanmonstar
Copy link
Member

Unfortunately, it can't just be merged, as it's a breaking change.

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