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

Replace Rails content_type header with media_type #2506

Closed
hannahramadan opened this issue Mar 13, 2024 · 1 comment · Fixed by #2855
Closed

Replace Rails content_type header with media_type #2506

hannahramadan opened this issue Mar 13, 2024 · 1 comment · Fixed by #2855
Assignees
Labels
oct-dec qtr Possible FY Q3 candidate

Comments

@hannahramadan
Copy link
Contributor

hannahramadan commented Mar 13, 2024

A change in Rails 6.1 -> Rails 7 includes ActionDispatch::Request#content_type now returns Content-Type header as it is.

Where the call request.content_type used to return 'text/csv' in Rails 6, it now returns the entire header, something like 'text/csv;header=present;charset=utf-16' in Rails 7. To return just the MIME type, one woud call request.media_type. This is what the agent is expected to send via spec. Definition.

We should replace calls to request.content_type with request.media_type. We should confirm request.media_type exists in older Rails versions. Already confirmed in Rails 6.

Discovered in #2500

@workato-integration
Copy link

@workato-integration workato-integration bot changed the title Replace Rails content_type header with media_type Replace Rails content_type header with media_type Mar 13, 2024
@kford-newrelic kford-newrelic added the estimate Issue needing estimation label Mar 29, 2024
@hannahramadan hannahramadan self-assigned this Sep 10, 2024
@hannahramadan hannahramadan added the oct-dec qtr Possible FY Q3 candidate label Sep 10, 2024
@kford-newrelic kford-newrelic moved this from In Sprint to In Quarter in Ruby Engineering Board Sep 25, 2024
@kford-newrelic kford-newrelic removed the estimate Issue needing estimation label Sep 25, 2024
@github-project-automation github-project-automation bot moved this from In Quarter to Code Complete/Done in Ruby Engineering Board Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oct-dec qtr Possible FY Q3 candidate
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants