{"action":"created","issue":{"url":"https://api.github.com/repos/Anaminus/roblox-bug-tracker/issues/312","labels_url":"https://api.github.com/repos/Anaminus/roblox-bug-tracker/issues/312/labels{/name}","comments_url":"https://api.github.com/repos/Anaminus/roblox-bug-tracker/issues/312/comments","events_url":"https://api.github.com/repos/Anaminus/roblox-bug-tracker/issues/312/events","html_url":"https://github.com/Anaminus/roblox-bug-tracker/issues/312","id":34927356,"number":312,"title":"HttpService.PostAsync unexpectedly compresses bodies larger than 256 bytes","user":{"login":"matthewdean","id":4099467,"avatar_url":"https://avatars.githubusercontent.com/u/4099467?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewdean","html_url":"https://github.com/matthewdean","followers_url":"https://api.github.com/users/matthewdean/followers","following_url":"https://api.github.com/users/matthewdean/following{/other_user}","gists_url":"https://api.github.com/users/matthewdean/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewdean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewdean/subscriptions","organizations_url":"https://api.github.com/users/matthewdean/orgs","repos_url":"https://api.github.com/users/matthewdean/repos","events_url":"https://api.github.com/users/matthewdean/events{/privacy}","received_events_url":"https://api.github.com/users/matthewdean/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Anaminus/roblox-bug-tracker/labels/bug","name":"bug","color":"ff4040"},{"url":"https://api.github.com/repos/Anaminus/roblox-bug-tracker/labels/Engine","name":"Engine","color":"444444"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-06-04T04:07:43Z","updated_at":"2015-07-15T04:56:25Z","closed_at":"2015-07-15T04:56:25Z","body":"If HttpService.PostAsync is called with a request body larger than 256 bytes, then the request body is compressed with gzip. This is unexpected behavior and many web servers do not support decompression of request bodies out of the box, so I believe the default behavior of HttpService should be to skip compression.\r\n\r\nReproduction code\r\n------------------------\r\n```lua\r\nlocal body = string.rep(\"a\", 256)\r\ngame:GetService(\"HttpService\"):PostAsync(\"http://example.org\", body)\r\n```\r\n```http\r\nPOST http://example.org/ HTTP/1.1\r\nContent-Length: 256\r\n\r\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n```\r\n\r\nBut if we add one more byte to the request body, notice what happens:\r\n\r\n```lua\r\nlocal body = string.rep(\"a\", 257)\r\ngame:GetService(\"HttpService\"):PostAsync(\"http://example.org\", body)\r\n```\r\n```http\r\nPOST http://example.org/ HTTP/1.1\r\nContent-Encoding: gzip\r\nContent-Length: 24\r\n\r\n\u001F�\b�������KL\u001C���%*��\u0001\u0001��\r\n```"},"comment":{"url":"https://api.github.com/repos/Anaminus/roblox-bug-tracker/issues/comments/121487889","html_url":"https://github.com/Anaminus/roblox-bug-tracker/issues/312#issuecomment-121487889","issue_url":"https://api.github.com/repos/Anaminus/roblox-bug-tracker/issues/312","id":121487889,"user":{"login":"matthewdean","id":4099467,"avatar_url":"https://avatars.githubusercontent.com/u/4099467?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewdean","html_url":"https://github.com/matthewdean","followers_url":"https://api.github.com/users/matthewdean/followers","following_url":"https://api.github.com/users/matthewdean/following{/other_user}","gists_url":"https://api.github.com/users/matthewdean/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewdean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewdean/subscriptions","organizations_url":"https://api.github.com/users/matthewdean/orgs","repos_url":"https://api.github.com/users/matthewdean/repos","events_url":"https://api.github.com/users/matthewdean/events{/privacy}","received_events_url":"https://api.github.com/users/matthewdean/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T04:56:24Z","updated_at":"2015-07-15T04:56:24Z","body":"It appears to be intentional."}}