Commit 499e991e authored by Graham Leggett's avatar Graham Leggett
Browse files

Sorted out some content-type oddness with proxy_ftp.c

PR:
Obtained from:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88847 13f79535-47bb-0310-9956-ffa450edef68
parent 4edddeed
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -1452,18 +1452,17 @@ int ap_proxy_ftp_handler(request_rec *r, char *url)
    apr_table_setn(r->headers_out, "Date", dates);
    apr_table_setn(r->headers_out, "Server", ap_get_server_version());

    /* set content-type */
    if (parms[0] == 'd') {
	r->content_type = "text/html";
	apr_table_setn(r->headers_out, "Content-Type", r->content_type);
    }
    else {
	if (r->content_type != NULL) {
	    apr_table_setn(r->headers_out, "Content-Type", r->content_type);
	if (r->content_type) {
	    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
			 "proxy: FTP: Content-Type set to %s", r->content_type);
	}
	else {
	    apr_table_setn(r->headers_out, "Content-Type", ap_default_type(r));
	    r->content_type = ap_default_type(r);
	}
	if (parms[0] != 'a' && size != NULL) {
	    /* We "trust" the ftp server to really serve (size) bytes... */
@@ -1472,8 +1471,11 @@ int ap_proxy_ftp_handler(request_rec *r, char *url)
		         "proxy: FTP: Content-Length set to %s", size);
	}
    }
    apr_table_setn(r->headers_out, "Content-Type", r->content_type);
    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
		 "proxy: FTP: Content-Type set to %s", r->content_type);

    /* set content-encoding */
    if (r->content_encoding != NULL && r->content_encoding[0] != '\0') {
		ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
			     "proxy: FTP: Content-Encoding set to %s", r->content_encoding);