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

Add an accepts: option #1310

Closed
postmodern opened this Issue Jun 14, 2013 · 4 comments

Comments

Projects
None yet
5 participants
@postmodern
Contributor

postmodern commented Jun 14, 2013

Add an accepts: option as a companion to provides:. This option would compare the media-type of a request to the list of MIME types. This is the Sinatra condition I am currently using:

set(:accepts) do |*types|
  mime_types = types.map { |t| mime_type(t) }.compact

  condition { mime_types.include?(request.media_type) }
end
@DAddYE

This comment has been minimized.

Show comment
Hide comment
@DAddYE

DAddYE Jul 1, 2013

Member

@padrino/core-members any want to work on this, or @postmodern feel free to send us a pull request

Member

DAddYE commented Jul 1, 2013

@padrino/core-members any want to work on this, or @postmodern feel free to send us a pull request

@dariocravero

This comment has been minimized.

Show comment
Hide comment
@dariocravero

dariocravero Jul 8, 2013

Contributor

I think we can look at implementing it for the new router. Thoughts?

Contributor

dariocravero commented Jul 8, 2013

I think we can look at implementing it for the new router. Thoughts?

@ujifgc ujifgc added router and removed enhancement labels Feb 17, 2014

ujifgc added a commit that referenced this issue Mar 19, 2014

@namusyaka

This comment has been minimized.

Show comment
Hide comment
@namusyaka

namusyaka Mar 19, 2014

Member

Closed this in #1628
Please let me know if that is not good enough.

Member

namusyaka commented Mar 19, 2014

Closed this in #1628
Please let me know if that is not good enough.

@namusyaka namusyaka closed this Mar 19, 2014

@postmodern

This comment has been minimized.

Show comment
Hide comment
@postmodern

postmodern Mar 21, 2014

Contributor

Looks more robust than my little Sinatra condition. On a side note, has anyone tested how well Padrino is suited for Hyper Media APIs?

Contributor

postmodern commented Mar 21, 2014

Looks more robust than my little Sinatra condition. On a side note, has anyone tested how well Padrino is suited for Hyper Media APIs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment