bug 220832. Make sure that we don't use the extension from the URL when the server sent a Content-Disposition header with a filename.

r=bzbarsky sr=darin


git-svn-id: svn://10.0.0.236/trunk@147834 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cbiesinger%web.de 2003-10-10 13:43:15 +00:00
parent b612ae2e98
commit 4ea53d0464

View File

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim:expandtab:shiftwidth=2:tabstop=3:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim:expandtab:shiftwidth=2:tabstop=2:
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
@ -389,8 +389,8 @@ NS_IMETHODIMP nsExternalHelperAppService::DoContent(const char *aMimeContentType
// Firstly, get the content-disposition header
nsCAutoString disp;
ExtractDisposition(channel, disp);
nsAutoString filename;
if (!disp.IsEmpty()) {
nsAutoString filename;
GetFilenameFromDisposition(filename, disp, uri);
if (!filename.IsEmpty()) {
LOG(("Getting filename from disposition: Disp='%s', filename='%s'\n",
@ -406,8 +406,8 @@ NS_IMETHODIMP nsExternalHelperAppService::DoContent(const char *aMimeContentType
// If the method is post, don't bother getting the file extension;
// it will belong to a CGI script anyway
// Also, if we already have an extension, don't bother
if (uri && !methodIsPost && fileExtension.IsEmpty()) {
// Also, if we had a Content-Disposition header, don't bother
if (uri && !methodIsPost && filename.IsEmpty()) {
nsCOMPtr<nsIURL> url = do_QueryInterface(uri);
if (url) {