Skip to content

Expose the Accept header #51

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Expose the Accept header #51

wants to merge 4 commits into from

Conversation

Marwes
Copy link
Contributor

@Marwes Marwes commented Oct 18, 2019

Enables Accept without any deeper changes and exposes the internal Method of AccessControlRequestMethod. Probably a better way of doing this PR but this adds the features I need to migrate from https://github.com/dekellum/hyperx

@seanmonstar
Copy link
Member

Thanks for the PR!

The AccessControlRequestMethod change is easier to merge, can you make that a separate PR? When doing so, instead of exposing the field, I'd suggest making a method, or even impl From<AccessControlRequestMethod> for Method.

@Marwes Marwes changed the title Expose more functionality Expose the Accept header Oct 18, 2019
/// );
/// ```
#[derive(Debug, PartialEq, Eq)]
pub struct Accept(pub Vec<QualityValue<Mime>>);
Copy link
Member

Choose a reason for hiding this comment

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

This crate has tried to be very conservative in what details it exposes, to try to allow the internal representations to change without it being a breaking change. So at the very least, I'd keep the fields private.

@@ -33,21 +32,18 @@ impl Default for Quality {

/// Represents an item with a quality value as defined in
/// [RFC7231](https://tools.ietf.org/html/rfc7231#section-5.3.1).
#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct QualityValue<T> {
Copy link
Member

Choose a reason for hiding this comment

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

I've felt for a while now that the QualityValue design is kind of annoying to use, but I've never sat down to come up with a better one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't say I have any better idea. The API looks ok to me, at least there isn't anything that should be clearly removed

@nerdrew
Copy link

nerdrew commented Dec 10, 2022

Is there anything blocking this PR from getting merged?

@tlovell-sxt
Copy link

bumping interest in this PR, or at least interest in having the accept header available

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