{"action":"created","issue":{"url":"https://api.github.com/repos/begriffs/postgrest/issues/456","labels_url":"https://api.github.com/repos/begriffs/postgrest/issues/456/labels{/name}","comments_url":"https://api.github.com/repos/begriffs/postgrest/issues/456/comments","events_url":"https://api.github.com/repos/begriffs/postgrest/issues/456/events","html_url":"https://github.com/begriffs/postgrest/issues/456","id":126542897,"number":456,"title":"Postgrest returns empty status when new-lines are in JSON payload","user":{"login":"ekosz","id":212829,"avatar_url":"https://avatars.githubusercontent.com/u/212829?v=3","gravatar_id":"","url":"https://api.github.com/users/ekosz","html_url":"https://github.com/ekosz","followers_url":"https://api.github.com/users/ekosz/followers","following_url":"https://api.github.com/users/ekosz/following{/other_user}","gists_url":"https://api.github.com/users/ekosz/gists{/gist_id}","starred_url":"https://api.github.com/users/ekosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekosz/subscriptions","organizations_url":"https://api.github.com/users/ekosz/orgs","repos_url":"https://api.github.com/users/ekosz/repos","events_url":"https://api.github.com/users/ekosz/events{/privacy}","received_events_url":"https://api.github.com/users/ekosz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-01-13T23:45:17Z","updated_at":"2016-01-15T18:50:51Z","closed_at":null,"body":"When I try to create a record with a payload with multiple new lines like this:\r\n\r\n```\r\nPOST /updates\r\n\r\n{\r\n  \"comment\": \"Foobar\\n\\nbarbar\" \r\n}\r\n```\r\n\r\nPostgrest then returns an empty response. As in no headers or anything. On NodeJS this acts as a `socket hang up` error. Using Postman is shows up as \r\n\r\n````\r\nThis seems to be like an error connecting to http://xxx/updates. The response status was 0.\r\nCheck out the W3C XMLHttpRequest Level 2 spec for more details about when this happens.\r\n```\r\n\r\nStrangely this only happens with my Postgrest running on Heroku but not the version I have running locally. My local version is `3.0.3`, while it seems the version on Heroku is `3.0.0`. But looking at the Changelog I don't see anything that would address an issue like this one.\r\n\r\nDo you know if this is a fixed issue already? If so, is there advice on how to upgrade Postgrest on Heroku while still using the [postgrest-heroku](https://github.com/begriffs/postgrest-heroku) buildpack?\r\n\r\nIf not, what can I do to help debug this issue for you all?"},"comment":{"url":"https://api.github.com/repos/begriffs/postgrest/issues/comments/172050266","html_url":"https://github.com/begriffs/postgrest/issues/456#issuecomment-172050266","issue_url":"https://api.github.com/repos/begriffs/postgrest/issues/456","id":172050266,"user":{"login":"ekosz","id":212829,"avatar_url":"https://avatars.githubusercontent.com/u/212829?v=3","gravatar_id":"","url":"https://api.github.com/users/ekosz","html_url":"https://github.com/ekosz","followers_url":"https://api.github.com/users/ekosz/followers","following_url":"https://api.github.com/users/ekosz/following{/other_user}","gists_url":"https://api.github.com/users/ekosz/gists{/gist_id}","starred_url":"https://api.github.com/users/ekosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekosz/subscriptions","organizations_url":"https://api.github.com/users/ekosz/orgs","repos_url":"https://api.github.com/users/ekosz/repos","events_url":"https://api.github.com/users/ekosz/events{/privacy}","received_events_url":"https://api.github.com/users/ekosz/received_events","type":"User","site_admin":false},"created_at":"2016-01-15T18:50:51Z","updated_at":"2016-01-15T18:50:51Z","body":"This is the response I got back from Heroku:\r\n\r\n> Hi Eric,\r\n\r\n> We did some investigating and it looks like the problem here is that your application is returning an invalid response which is causing our router process to crash. Here's the raw contents of the response:\r\n\r\n> ```\r\n> transfer-encoding: chunked\r\n> Date: Fri, 15 Jan 2016 01:47:14 GMT\r\n> Server: postgrest/0.3.0.3\r\n> Content-Type: application/json\r\n> Location: /updates?id=is.null&status=is.null&comment=eq.Foobar   <---- !!! issue is here !!!\r\n>  barbar&increment=is.null&company_id=is.null&goal_id=is.null&creator_id=is.null&created_at=is.null&updated_at=is.null\r\n\r\n> 009E\r\n> {\"id\":null,\"status\":null,\"comment\":\"Foobar\\n\\nbarbar\",\"increment\":null,\"company_id\":null,\"goal_id\":null,\"creator_id\":null,\"created_at\":null,\"updated_at\":null}\r\n> 0\r\n> ```\r\n\r\n> The location header contains an unencoded newline, which isn't valid. If you can get that fixed, the issue should stop happening. Let me know if you have any questions.\r\n\r\nSo it looks like whatever software / hardware they're using it really doesn't like invalid headers. @begriffs do you know if Postgrest is already url encoding the `location` header?"}}