Bug 29947 - Text/plain as Content-Type for FTP binary transfers
Summary: Text/plain as Content-Type for FTP binary transfers
Status: CLOSED WONTFIX
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 2.0-HEAD
Hardware: All Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2004-07-07 12:42 UTC by Thomas Jarosch
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
Workaround-patch for this bug (648 bytes, patch)
2004-07-07 12:43 UTC, Thomas Jarosch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Jarosch 2004-07-07 12:42:25 UTC
mod_proxy uses "text/plain" as Content-Type for proxied FTP binary transfers. 
Most browsers don't show their fancy "Save to disk" box for ISO images, 
instead they start showing binary garbage in the browser. 
 
I've created a small patch to force the Content-Type to "binary" 
for FTP binary transfers.
Comment 1 Thomas Jarosch 2004-07-07 12:43:43 UTC
Created attachment 12052 [details]
Workaround-patch for this bug
Comment 2 Nick Kew 2004-07-07 15:38:02 UTC
Isn't this really a configuration error?  We already have

        if (r->content_type) {
            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                     "proxy: FTP: Content-Type set to %s", r->content_type);
        }
        else {
            ap_set_content_type(r, ap_default_type(r));
        }

so the real fix is a DefaultType directive for the proxy.

Or am I missing something?
Comment 3 Thomas Jarosch 2004-07-07 17:46:57 UTC
Thanks! 
Adding  
 
<Proxy *> 
  DefaultType application/octet-stream 
</Prox> 
 
works. But this will change the content type of every proxy request with 
unknown mime type. Or can this be changed only for mod_proxy_ftp? 
 
Comment 4 Nick Kew 2004-07-10 16:49:14 UTC
I've added a note about this to the mod_proxy documentation (in CVS).

I'm neutral-to-slightly-negative on the subject of adding your patch.  So unless
you can convince me or someone, I'm inclined to close this as WONTFIX.

As for changing every request with unknown MIME type - that's a red herring. 
Any HTTP response MUST have a mime type, so it's only FTP that's affected.  And
even if an "HTTP" server violates this part of the spec, how better could we
handle it than by falling back to FTP behaviour?
Comment 5 Thomas Jarosch 2004-07-10 16:58:24 UTC
Good point. I think closing this bug with the documentation note is the best 
thing to do. 
 
Thanks again, 
Thomas