{"action":"created","issue":{"url":"https://api.github.com/repos/drewzboto/grunt-connect-proxy/issues/73","labels_url":"https://api.github.com/repos/drewzboto/grunt-connect-proxy/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/drewzboto/grunt-connect-proxy/issues/73/comments","events_url":"https://api.github.com/repos/drewzboto/grunt-connect-proxy/issues/73/events","html_url":"https://github.com/drewzboto/grunt-connect-proxy/issues/73","id":42440413,"number":73,"title":"Unable to download pdf files through the proxy","user":{"login":"reda-alaoui","id":2890843,"avatar_url":"https://avatars.githubusercontent.com/u/2890843?v=3","gravatar_id":"","url":"https://api.github.com/users/reda-alaoui","html_url":"https://github.com/reda-alaoui","followers_url":"https://api.github.com/users/reda-alaoui/followers","following_url":"https://api.github.com/users/reda-alaoui/following{/other_user}","gists_url":"https://api.github.com/users/reda-alaoui/gists{/gist_id}","starred_url":"https://api.github.com/users/reda-alaoui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reda-alaoui/subscriptions","organizations_url":"https://api.github.com/users/reda-alaoui/orgs","repos_url":"https://api.github.com/users/reda-alaoui/repos","events_url":"https://api.github.com/users/reda-alaoui/events{/privacy}","received_events_url":"https://api.github.com/users/reda-alaoui/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2014-09-10T17:53:47Z","updated_at":"2015-02-25T16:47:50Z","closed_at":null,"body":"Hi everyone,\r\n\r\nI am unable to download pdf files through the proxy served by an ordinary servlet at `/myapp/pdfservlet/` on my tomcat server.\r\nWhen I try without proxy, pdf files are correctly downloaded.\r\n\r\nHere is my proxy configuration:\r\n```javascript\r\n{\r\n\tcontext: '/', // the context of the data service\r\n\thost: localhost, // wherever the data service is running\r\n\tport: 8080, // the port that the data service is running on\r\n\tws: true, // Proxy websocket\r\n\trewrite: { '^/myapp/realtime/fallback':  '/myapp/realtime'},\r\n        excludedFileTypes: ['pdf', 'jar', 'gz']\r\n}\r\n```\r\n\r\nHere is the request/response given by Chrome:\r\n\r\n<pre>\r\n<b>Remote Address</b>:127.0.0.1:9000\r\n<b>Request URL</b>:http://localhost:9000/myapp/pdfservlet\r\n<b>Request Method</b>:GET\r\n<b>Status Code</b>:200 OK\r\n\r\n<i><b>Request Headers</b></i>\r\n<b>Accept</b>:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n<b>Accept-Encoding</b>:gzip,deflate,sdch\r\n<b>Accept-Language</b>:fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4,de;q=0.2,es;q=0.2\r\n<b>Connection</b>:keep-alive\r\n<b>Host</b>:localhost:9000\r\n<b>Referer</b>:http://localhost:9000/myapp/jsp/foo.jsp\r\n<b>User-Agent</b>:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36\r\n\r\n<i><b>Response Headers</b></i>\r\n<b>connection</b>:close\r\n<b>content-disposition</b>:filename=\"foo.pdf\"\r\n<b>content-language</b>:fr-FR\r\n<b>content-type</b>:application/pdf;charset=UTF-8\r\n<b>date</b>:Wed, 10 Sep 2014 17:36:13 GMT\r\n<b>server</b>:Apache-Coyote/1.1\r\n<b>transfer-encoding</b>:chunked\r\n\r\n</pre>\r\n\r\nIt also happens on `.gz` files.\r\nIt seems that the connection is closed before the end of the file because the pdf is just blank.\r\n\r\nAm I missing something?"},"comment":{"url":"https://api.github.com/repos/drewzboto/grunt-connect-proxy/issues/comments/75998015","html_url":"https://github.com/drewzboto/grunt-connect-proxy/issues/73#issuecomment-75998015","issue_url":"https://api.github.com/repos/drewzboto/grunt-connect-proxy/issues/73","id":75998015,"user":{"login":"michi88","id":1010260,"avatar_url":"https://avatars.githubusercontent.com/u/1010260?v=3","gravatar_id":"","url":"https://api.github.com/users/michi88","html_url":"https://github.com/michi88","followers_url":"https://api.github.com/users/michi88/followers","following_url":"https://api.github.com/users/michi88/following{/other_user}","gists_url":"https://api.github.com/users/michi88/gists{/gist_id}","starred_url":"https://api.github.com/users/michi88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michi88/subscriptions","organizations_url":"https://api.github.com/users/michi88/orgs","repos_url":"https://api.github.com/users/michi88/repos","events_url":"https://api.github.com/users/michi88/events{/privacy}","received_events_url":"https://api.github.com/users/michi88/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T16:47:50Z","updated_at":"2015-02-25T16:47:50Z","body":"+1 same problem here"}}