This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | isGZip method should use Content-Encoding header instead of check the update center URL file extension | ||
---|---|---|---|
Product: | platform | Reporter: | matteodg <matteodg> |
Component: | Autoupdate | Assignee: | Jiri Rechtacek <jrechtacek> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | NETFIX |
Priority: | P3 | ||
Version: | 7.0.1 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Proposed patch |
Description
matteodg
2011-09-07 12:05:25 UTC
Makes sense, a patch will be welcome. Thanks Created attachment 110526 [details]
Proposed patch
I open the connection to URL and I check for Content-Type HTTP header to be equals to "application/x-gzip".
Thanks for your patch, I'm going to review and push ASAP. Thanks for your patch, was applied by core-main/rev/6259ed23bf45 Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/6259ed23bf45 User: Jiri Rechtacek <jrechtacek@netbeans.org> Log: #201738: isGZip method should use Content-Encoding header instead of check the update center URL file extension; applied matteodg's patch, thanks BTW, this patch brakes AU work on file URLs (file:/something). At least, on Windows it does not throw IOException and doesn't fall into the catch block. For me it returns different values of contentType for different files (e.g. text/plain for .xml). For *.gz it returns (for me) "application/octet-stream" (like for many other binaries). Dima, thanks for catching this. I'm going to improve the patch to work in both cases. Thanks the corrected patch - core-main/rev/27f384c1d0fa That corrected patch does not allow to use a non .gz extension for the page: we are using a dynamic page (.cfm, .php, etc.) in order to track how many users are downloading the updates. So that's why we needed to check the Content-Type in NetBeans for understanding if the stream is gzipped or not. (In reply to comment #9) > That corrected patch does not allow to use a non .gz extension for the page: we It does. If not, reopen with a test-case which doesn't work. Thanks Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/27f384c1d0fa User: Jiri Rechtacek <jrechtacek@netbeans.org> Log: correction of impl #201738; previous impl. breaks reading .gz from local file |