Skip to content
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

extension synonyms yml and yaml #24318

Merged
merged 1 commit into from
Apr 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions actionpack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Add extension synonyms `yml` and `yaml` for MIME type `application/x-yaml`.

*bogdanvlviv*

* When a `respond_to` collector with a block doesn't have a response, then
a `:no_content` response should be rendered. This brings the default
rendering behavior introduced by https://github.com/rails/rails/issues/19036
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/http/mime_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Mime::Type.register "application/xml", :xml, %w( text/xml application/x-xml )
Copy link
Contributor

Choose a reason for hiding this comment

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

should .xml extension likewise be registered?

also, perhaps refactor Mime::Type.register API to use kwargs? (with deprecated current form)

Copy link
Member

Choose a reason for hiding this comment

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

.xml extension is already registered no?

Copy link
Contributor

Choose a reason for hiding this comment

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

If it is nevermind, just not clear from this line Mime::Type.register "application/xml", :xml, %w( text/xml application/x-xml ) as it's not passed as the extension argument.

Copy link
Member

Choose a reason for hiding this comment

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

you only need to pass the extension argument if you want to create aliases.

Mime::Type.register "application/rss+xml", :rss
Mime::Type.register "application/atom+xml", :atom
Mime::Type.register "application/x-yaml", :yaml, %w( text/yaml )
Mime::Type.register "application/x-yaml", :yaml, %w( text/yaml ), %w(yml yaml)

Mime::Type.register "multipart/form-data", :multipart_form
Mime::Type.register "application/x-www-form-urlencoded", :url_encoded_form
Expand Down