{"action":"created","issue":{"url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/3050","repository_url":"https://api.github.com/repos/SparkDevNetwork/Rock","labels_url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/3050/labels{/name}","comments_url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/3050/comments","events_url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/3050/events","html_url":"https://github.com/SparkDevNetwork/Rock/pull/3050","id":330460356,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNDY2NDY1","number":3050,"title":"Fix up file handlers (Fixes #2599)","user":{"login":"Tschrock","id":2406499,"node_id":"MDQ6VXNlcjI0MDY0OTk=","avatar_url":"https://avatars1.githubusercontent.com/u/2406499?v=4","gravatar_id":"","url":"https://api.github.com/users/Tschrock","html_url":"https://github.com/Tschrock","followers_url":"https://api.github.com/users/Tschrock/followers","following_url":"https://api.github.com/users/Tschrock/following{/other_user}","gists_url":"https://api.github.com/users/Tschrock/gists{/gist_id}","starred_url":"https://api.github.com/users/Tschrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tschrock/subscriptions","organizations_url":"https://api.github.com/users/Tschrock/orgs","repos_url":"https://api.github.com/users/Tschrock/repos","events_url":"https://api.github.com/users/Tschrock/events{/privacy}","received_events_url":"https://api.github.com/users/Tschrock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-07T22:39:55Z","updated_at":"2018-07-06T07:53:17Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/SparkDevNetwork/Rock/pulls/3050","html_url":"https://github.com/SparkDevNetwork/Rock/pull/3050","diff_url":"https://github.com/SparkDevNetwork/Rock/pull/3050.diff","patch_url":"https://github.com/SparkDevNetwork/Rock/pull/3050.patch"},"body":"## Context\r\nThe original problem was that the get file handlers responded improperly to some requests and were generating a lot of exceptions in those cases (See #2599). I've also discovered some more issues with them in the process of fixing that issue.\r\n\r\n## Changes:\r\n1. `GetFile.ashx.cs`\r\n    - Removed content file support (the `isBinaryFile` parameter).\r\n        - The current implementation has been broken for a while.\r\n        - I can't find it used anywhere.\r\n        - It's unnecessary (These files can already be accessed from `/Content`).\r\n    - Invalid parameter options now return a 400 Bad Request instead of throwing an exception.\r\n    - Missing or deleted files now return a 404 Not Found instead of throwing an exception.\r\n        - For this, `BinaryFileService.EndGet()` was modified to properly check if data could be read, and now returns null if a file is missing instead of throwing an exception (existing usages already expect this behavior).\r\n    - Changed `IsReusable` to return `true`.\r\n        - Since we don't store the current request state in the handler, we can tell IIS to reuse it instead of making a new one for each request. This should make it a tiny bit more efficient.\r\n2. `GetImage.ashx.cs`\r\n    - Content files (`?isBinaryFile=F`):\r\n        - Fixed issues with path handling\r\n        - Fixed parameter counting for determining if a content file should try to be resized.\r\n        - Missing or deleted content files now return a 404 Not Found instead of an empty 200 Success.\r\n        - Invalid content files now return a 400 Bad Request instead of an empty 200 Success.\r\n        - Content files that don't have permission to be read now return a 403 Forbidden instead of an empty 200 Success.\r\n    - Binary files (`?isBinaryFile=T`):\r\n        - Invalid parameters now return a 400 Bad Request instead of an empty 200 Success.\r\n        - Fixed an issue with file security\r\n    - General:\r\n        - Exceptions now return a 500 Internal Server Error instead of an empty 200 Success.\r\n        - Files that fail to resize now fallback to their original content instead of throwing an ObjectDisposedException.\r\n        - Changed `IsReusable` to return `true`.\r\n            - Since we don't store the current request state in the handler, we can tell IIS to reuse it instead of making a new one for each request. This should make it a tiny bit more efficient.\r\n3. `FileUploader.ashx.cs`\r\n    - Content files (`?isBinaryFile=F`):\r\n        - Fixed issues with path handling.\r\n        - Changed handling to prevent overwriting existing files (If you actually need to replace a file, you should delete it in the file browser and re-upload it).\r\n    - General\r\n        - Fixed file type validation.\r\n3. `ImageUploader.ashx.cs`\r\n    - Fixed file type validation.\r\n"},"comment":{"url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/comments/402956705","html_url":"https://github.com/SparkDevNetwork/Rock/pull/3050#issuecomment-402956705","issue_url":"https://api.github.com/repos/SparkDevNetwork/Rock/issues/3050","id":402956705,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjk1NjcwNQ==","user":{"login":"Tschrock","id":2406499,"node_id":"MDQ6VXNlcjI0MDY0OTk=","avatar_url":"https://avatars1.githubusercontent.com/u/2406499?v=4","gravatar_id":"","url":"https://api.github.com/users/Tschrock","html_url":"https://github.com/Tschrock","followers_url":"https://api.github.com/users/Tschrock/followers","following_url":"https://api.github.com/users/Tschrock/following{/other_user}","gists_url":"https://api.github.com/users/Tschrock/gists{/gist_id}","starred_url":"https://api.github.com/users/Tschrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tschrock/subscriptions","organizations_url":"https://api.github.com/users/Tschrock/orgs","repos_url":"https://api.github.com/users/Tschrock/repos","events_url":"https://api.github.com/users/Tschrock/events{/privacy}","received_events_url":"https://api.github.com/users/Tschrock/received_events","type":"User","site_admin":false},"created_at":"2018-07-06T07:53:17Z","updated_at":"2018-07-06T07:53:17Z","author_association":"COLLABORATOR","body":"Sorry for the late update, we've been really busy lately. This should address the two issues that were brought up."}}
{"actor":{"display_login":"Tschrock"}}