{"action":"closed","number":57,"pull_request":{"url":"https://api.github.com/repos/mattt/sinatra-param/pulls/57","id":46741492,"html_url":"https://github.com/mattt/sinatra-param/pull/57","diff_url":"https://github.com/mattt/sinatra-param/pull/57.diff","patch_url":"https://github.com/mattt/sinatra-param/pull/57.patch","issue_url":"https://api.github.com/repos/mattt/sinatra-param/issues/57","number":57,"state":"closed","locked":false,"title":"send text/plain on non-JSON responses","user":{"login":"stve","id":28044,"avatar_url":"https://avatars3.githubusercontent.com/u/28044?v=4","gravatar_id":"","url":"https://api.github.com/users/stve","html_url":"https://github.com/stve","followers_url":"https://api.github.com/users/stve/followers","following_url":"https://api.github.com/users/stve/following{/other_user}","gists_url":"https://api.github.com/users/stve/gists{/gist_id}","starred_url":"https://api.github.com/users/stve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stve/subscriptions","organizations_url":"https://api.github.com/users/stve/orgs","repos_url":"https://api.github.com/users/stve/repos","events_url":"https://api.github.com/users/stve/events{/privacy}","received_events_url":"https://api.github.com/users/stve/received_events","type":"User","site_admin":false},"body":"I stumbled on this recently in one of our APIs and was surprised that I never realized it before. For non-JSON APIs (which are handled properly) the response is `text/plain` but the actual `Content-Type` of the response is not altered and has the potential to be incorrect. \n\nIn our circumstance, we have an API that returns XML but when there's errors the content type is `application/xml` but the actual body of the response is of the pattern `\"Parameter is required\"`. I know this library heavily favors JSON, but seems like the proper way to handle non-JSON responses.\n","created_at":"2015-10-05T03:12:40Z","updated_at":"2018-03-20T15:11:18Z","closed_at":"2018-03-20T15:11:18Z","merged_at":"2018-03-20T15:11:18Z","merge_commit_sha":"92d3db0f05e3c329055acb8ae155534fd40e6c04","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mattt/sinatra-param/pulls/57/commits","review_comments_url":"https://api.github.com/repos/mattt/sinatra-param/pulls/57/comments","review_comment_url":"https://api.github.com/repos/mattt/sinatra-param/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattt/sinatra-param/issues/57/comments","statuses_url":"https://api.github.com/repos/mattt/sinatra-param/statuses/a05dda32bcbe76e3e1870ae346060fd29cadc37c","head":{"label":"stve:content_types","ref":"content_types","sha":"a05dda32bcbe76e3e1870ae346060fd29cadc37c","user":{"login":"stve","id":28044,"avatar_url":"https://avatars3.githubusercontent.com/u/28044?v=4","gravatar_id":"","url":"https://api.github.com/users/stve","html_url":"https://github.com/stve","followers_url":"https://api.github.com/users/stve/followers","following_url":"https://api.github.com/users/stve/following{/other_user}","gists_url":"https://api.github.com/users/stve/gists{/gist_id}","starred_url":"https://api.github.com/users/stve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stve/subscriptions","organizations_url":"https://api.github.com/users/stve/orgs","repos_url":"https://api.github.com/users/stve/repos","events_url":"https://api.github.com/users/stve/events{/privacy}","received_events_url":"https://api.github.com/users/stve/received_events","type":"User","site_admin":false},"repo":{"id":19986573,"name":"sinatra-param","full_name":"stve/sinatra-param","owner":{"login":"stve","id":28044,"avatar_url":"https://avatars3.githubusercontent.com/u/28044?v=4","gravatar_id":"","url":"https://api.github.com/users/stve","html_url":"https://github.com/stve","followers_url":"https://api.github.com/users/stve/followers","following_url":"https://api.github.com/users/stve/following{/other_user}","gists_url":"https://api.github.com/users/stve/gists{/gist_id}","starred_url":"https://api.github.com/users/stve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stve/subscriptions","organizations_url":"https://api.github.com/users/stve/orgs","repos_url":"https://api.github.com/users/stve/repos","events_url":"https://api.github.com/users/stve/events{/privacy}","received_events_url":"https://api.github.com/users/stve/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stve/sinatra-param","description":"Parameter Validation & Type Coercion for Sinatra","fork":true,"url":"https://api.github.com/repos/stve/sinatra-param","forks_url":"https://api.github.com/repos/stve/sinatra-param/forks","keys_url":"https://api.github.com/repos/stve/sinatra-param/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stve/sinatra-param/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stve/sinatra-param/teams","hooks_url":"https://api.github.com/repos/stve/sinatra-param/hooks","issue_events_url":"https://api.github.com/repos/stve/sinatra-param/issues/events{/number}","events_url":"https://api.github.com/repos/stve/sinatra-param/events","assignees_url":"https://api.github.com/repos/stve/sinatra-param/assignees{/user}","branches_url":"https://api.github.com/repos/stve/sinatra-param/branches{/branch}","tags_url":"https://api.github.com/repos/stve/sinatra-param/tags","blobs_url":"https://api.github.com/repos/stve/sinatra-param/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stve/sinatra-param/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stve/sinatra-param/git/refs{/sha}","trees_url":"https://api.github.com/repos/stve/sinatra-param/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stve/sinatra-param/statuses/{sha}","languages_url":"https://api.github.com/repos/stve/sinatra-param/languages","stargazers_url":"https://api.github.com/repos/stve/sinatra-param/stargazers","contributors_url":"https://api.github.com/repos/stve/sinatra-param/contributors","subscribers_url":"https://api.github.com/repos/stve/sinatra-param/subscribers","subscription_url":"https://api.github.com/repos/stve/sinatra-param/subscription","commits_url":"https://api.github.com/repos/stve/sinatra-param/commits{/sha}","git_commits_url":"https://api.github.com/repos/stve/sinatra-param/git/commits{/sha}","comments_url":"https://api.github.com/repos/stve/sinatra-param/comments{/number}","issue_comment_url":"https://api.github.com/repos/stve/sinatra-param/issues/comments{/number}","contents_url":"https://api.github.com/repos/stve/sinatra-param/contents/{+path}","compare_url":"https://api.github.com/repos/stve/sinatra-param/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stve/sinatra-param/merges","archive_url":"https://api.github.com/repos/stve/sinatra-param/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stve/sinatra-param/downloads","issues_url":"https://api.github.com/repos/stve/sinatra-param/issues{/number}","pulls_url":"https://api.github.com/repos/stve/sinatra-param/pulls{/number}","milestones_url":"https://api.github.com/repos/stve/sinatra-param/milestones{/number}","notifications_url":"https://api.github.com/repos/stve/sinatra-param/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stve/sinatra-param/labels{/name}","releases_url":"https://api.github.com/repos/stve/sinatra-param/releases{/id}","deployments_url":"https://api.github.com/repos/stve/sinatra-param/deployments","created_at":"2014-05-20T15:31:56Z","updated_at":"2014-09-17T05:14:16Z","pushed_at":"2015-10-05T03:43:09Z","git_url":"git://github.com/stve/sinatra-param.git","ssh_url":"git@github.com:stve/sinatra-param.git","clone_url":"https://github.com/stve/sinatra-param.git","svn_url":"https://github.com/stve/sinatra-param","homepage":"","size":224,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mattt:master","ref":"master","sha":"b8569286746b206f889687fe3898888f95fa1d7e","user":{"login":"mattt","id":7659,"avatar_url":"https://avatars0.githubusercontent.com/u/7659?v=4","gravatar_id":"","url":"https://api.github.com/users/mattt","html_url":"https://github.com/mattt","followers_url":"https://api.github.com/users/mattt/followers","following_url":"https://api.github.com/users/mattt/following{/other_user}","gists_url":"https://api.github.com/users/mattt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattt/subscriptions","organizations_url":"https://api.github.com/users/mattt/orgs","repos_url":"https://api.github.com/users/mattt/repos","events_url":"https://api.github.com/users/mattt/events{/privacy}","received_events_url":"https://api.github.com/users/mattt/received_events","type":"User","site_admin":false},"repo":{"id":4170384,"name":"sinatra-param","full_name":"mattt/sinatra-param","owner":{"login":"mattt","id":7659,"avatar_url":"https://avatars0.githubusercontent.com/u/7659?v=4","gravatar_id":"","url":"https://api.github.com/users/mattt","html_url":"https://github.com/mattt","followers_url":"https://api.github.com/users/mattt/followers","following_url":"https://api.github.com/users/mattt/following{/other_user}","gists_url":"https://api.github.com/users/mattt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattt/subscriptions","organizations_url":"https://api.github.com/users/mattt/orgs","repos_url":"https://api.github.com/users/mattt/repos","events_url":"https://api.github.com/users/mattt/events{/privacy}","received_events_url":"https://api.github.com/users/mattt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattt/sinatra-param","description":"Parameter Validation & Type Coercion for Sinatra","fork":false,"url":"https://api.github.com/repos/mattt/sinatra-param","forks_url":"https://api.github.com/repos/mattt/sinatra-param/forks","keys_url":"https://api.github.com/repos/mattt/sinatra-param/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattt/sinatra-param/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattt/sinatra-param/teams","hooks_url":"https://api.github.com/repos/mattt/sinatra-param/hooks","issue_events_url":"https://api.github.com/repos/mattt/sinatra-param/issues/events{/number}","events_url":"https://api.github.com/repos/mattt/sinatra-param/events","assignees_url":"https://api.github.com/repos/mattt/sinatra-param/assignees{/user}","branches_url":"https://api.github.com/repos/mattt/sinatra-param/branches{/branch}","tags_url":"https://api.github.com/repos/mattt/sinatra-param/tags","blobs_url":"https://api.github.com/repos/mattt/sinatra-param/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattt/sinatra-param/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattt/sinatra-param/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattt/sinatra-param/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattt/sinatra-param/statuses/{sha}","languages_url":"https://api.github.com/repos/mattt/sinatra-param/languages","stargazers_url":"https://api.github.com/repos/mattt/sinatra-param/stargazers","contributors_url":"https://api.github.com/repos/mattt/sinatra-param/contributors","subscribers_url":"https://api.github.com/repos/mattt/sinatra-param/subscribers","subscription_url":"https://api.github.com/repos/mattt/sinatra-param/subscription","commits_url":"https://api.github.com/repos/mattt/sinatra-param/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattt/sinatra-param/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattt/sinatra-param/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattt/sinatra-param/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattt/sinatra-param/contents/{+path}","compare_url":"https://api.github.com/repos/mattt/sinatra-param/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattt/sinatra-param/merges","archive_url":"https://api.github.com/repos/mattt/sinatra-param/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattt/sinatra-param/downloads","issues_url":"https://api.github.com/repos/mattt/sinatra-param/issues{/number}","pulls_url":"https://api.github.com/repos/mattt/sinatra-param/pulls{/number}","milestones_url":"https://api.github.com/repos/mattt/sinatra-param/milestones{/number}","notifications_url":"https://api.github.com/repos/mattt/sinatra-param/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattt/sinatra-param/labels{/name}","releases_url":"https://api.github.com/repos/mattt/sinatra-param/releases{/id}","deployments_url":"https://api.github.com/repos/mattt/sinatra-param/deployments","created_at":"2012-04-28T21:20:53Z","updated_at":"2018-03-20T15:08:01Z","pushed_at":"2018-03-20T15:11:18Z","git_url":"git://github.com/mattt/sinatra-param.git","ssh_url":"git@github.com:mattt/sinatra-param.git","clone_url":"https://github.com/mattt/sinatra-param.git","svn_url":"https://github.com/mattt/sinatra-param","homepage":"","size":551,"stargazers_count":459,"watchers_count":459,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":70,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":70,"open_issues":19,"watchers":459,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattt/sinatra-param/pulls/57"},"html":{"href":"https://github.com/mattt/sinatra-param/pull/57"},"issue":{"href":"https://api.github.com/repos/mattt/sinatra-param/issues/57"},"comments":{"href":"https://api.github.com/repos/mattt/sinatra-param/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/mattt/sinatra-param/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/mattt/sinatra-param/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattt/sinatra-param/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/mattt/sinatra-param/statuses/a05dda32bcbe76e3e1870ae346060fd29cadc37c"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"mattt","id":7659,"avatar_url":"https://avatars0.githubusercontent.com/u/7659?v=4","gravatar_id":"","url":"https://api.github.com/users/mattt","html_url":"https://github.com/mattt","followers_url":"https://api.github.com/users/mattt/followers","following_url":"https://api.github.com/users/mattt/following{/other_user}","gists_url":"https://api.github.com/users/mattt/gists{/gist_id}","starred_url":"https://api.github.com/users/mattt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattt/subscriptions","organizations_url":"https://api.github.com/users/mattt/orgs","repos_url":"https://api.github.com/users/mattt/repos","events_url":"https://api.github.com/users/mattt/events{/privacy}","received_events_url":"https://api.github.com/users/mattt/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":21,"deletions":0,"changed_files":3}}
{"actor":{"display_login":"mattt"}}