{"action":"created","issue":{"url":"https://api.github.com/repos/cherrypy/cheroot/issues/101","repository_url":"https://api.github.com/repos/cherrypy/cheroot","labels_url":"https://api.github.com/repos/cherrypy/cheroot/issues/101/labels{/name}","comments_url":"https://api.github.com/repos/cherrypy/cheroot/issues/101/comments","events_url":"https://api.github.com/repos/cherrypy/cheroot/issues/101/events","html_url":"https://github.com/cherrypy/cheroot/pull/101","id":332154691,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0NzA3OTYx","number":101,"title":"Fix #100 Non-int content-length header","user":{"login":"nosmokingbandit","id":10876233,"node_id":"MDQ6VXNlcjEwODc2MjMz","avatar_url":"https://avatars2.githubusercontent.com/u/10876233?v=4","gravatar_id":"","url":"https://api.github.com/users/nosmokingbandit","html_url":"https://github.com/nosmokingbandit","followers_url":"https://api.github.com/users/nosmokingbandit/followers","following_url":"https://api.github.com/users/nosmokingbandit/following{/other_user}","gists_url":"https://api.github.com/users/nosmokingbandit/gists{/gist_id}","starred_url":"https://api.github.com/users/nosmokingbandit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nosmokingbandit/subscriptions","organizations_url":"https://api.github.com/users/nosmokingbandit/orgs","repos_url":"https://api.github.com/users/nosmokingbandit/repos","events_url":"https://api.github.com/users/nosmokingbandit/events{/privacy}","received_events_url":"https://api.github.com/users/nosmokingbandit/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-06-13T20:37:54Z","updated_at":"2018-06-16T09:08:25Z","closed_at":"2018-06-15T22:00:23Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/cherrypy/cheroot/pulls/101","html_url":"https://github.com/cherrypy/cheroot/pull/101","diff_url":"https://github.com/cherrypy/cheroot/pull/101.diff","patch_url":"https://github.com/cherrypy/cheroot/pull/101.patch"},"body":"Use try/except to catch ValueError when converting content-length to int. Responds to client with 400 error rather than 500 error.\r\n\r\n* **What kind of change does this PR introduce?**\r\n  - [X] bug fix\r\n  - [ ] feature\r\n  - [ ] docs update\r\n  - [ ] tests/coverage improvement\r\n  - [ ] refactoring\r\n  - [ ] other\r\n\r\n\r\n\r\n* **What is the related issue number (starting with `#`)**\r\nFixes #100\r\n\r\n\r\n* **What is the current behavior?** (You can also link to an open issue here)\r\nServer returns ambiguous 500 error to client when Content-Length header is not an int or able to be converted to int.\r\n\r\n\r\n* **What is the new behavior (if this is a feature change)?**\r\nServer returns 400 error to client with message \"Malformed Content-Length Header.\"\r\n\r\n\r\n* **Other information**:\r\nI'm not 100% sure if there is a better 4XX response, but 400 is appropriate.\r\n\r\n* **Checklist**:\r\n\r\n  - [X] I think the code is well written\r\n  - [X] I wrote [good commit messages][1]\r\n  - [X] I have [squashed related commits together][2] after the changes have been approved\r\n  - [X] Unit tests for the changes exist\r\n  - [X] Integration tests for the changes exist (if applicable)\r\n  - [X] I used the same coding conventions as the rest of the project\r\n  - [X] The new code doesn't generate linter offenses\r\n  - [X] Documentation reflects the changes\r\n  - [X] The PR relates to *only* one subject with a clear title\r\n  and description in grammatically correct, complete sentences\r\n\r\n[1]: http://chris.beams.io/posts/git-commit/\r\n[2]: https://github.com/todotxt/todo.txt-android/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit\r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cherrypy/cheroot/101)\r\n<!-- Reviewable:end -->\r\n"},"comment":{"url":"https://api.github.com/repos/cherrypy/cheroot/issues/comments/397799353","html_url":"https://github.com/cherrypy/cheroot/pull/101#issuecomment-397799353","issue_url":"https://api.github.com/repos/cherrypy/cheroot/issues/101","id":397799353,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Nzc5OTM1Mw==","user":{"login":"webknjaz","id":578543,"node_id":"MDQ6VXNlcjU3ODU0Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/578543?v=4","gravatar_id":"","url":"https://api.github.com/users/webknjaz","html_url":"https://github.com/webknjaz","followers_url":"https://api.github.com/users/webknjaz/followers","following_url":"https://api.github.com/users/webknjaz/following{/other_user}","gists_url":"https://api.github.com/users/webknjaz/gists{/gist_id}","starred_url":"https://api.github.com/users/webknjaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webknjaz/subscriptions","organizations_url":"https://api.github.com/users/webknjaz/orgs","repos_url":"https://api.github.com/users/webknjaz/repos","events_url":"https://api.github.com/users/webknjaz/events{/privacy}","received_events_url":"https://api.github.com/users/webknjaz/received_events","type":"User","site_admin":false},"created_at":"2018-06-16T09:08:25Z","updated_at":"2018-06-16T09:08:25Z","author_association":"MEMBER","body":"Regarding `pytest`, we have `tox` in place, which you can use for running tests.\r\nFor example, if you want to run some specific test using tox, which will pre-populate virtualenv with all required dependencies, run: `tox -- -k test_Content_Length_Non_Int`. Args after `--` are bypassed to `pytest` command.\r\n\r\nIf you'd like to contribute, feel free to document to run tests in `docs/` folder and also one of the current focuses in Cheroot is to improve testing infrastructure, provide better-standardized fixtures in `cheroot.testing` and possibly to refactor tests by separating reusable parts from unique test logic."}}
{"actor":{"display_login":"webknjaz"}}