From 4ea53d04644f78393f0b4868d382cb30b2a938ca Mon Sep 17 00:00:00 2001 From: "cbiesinger%web.de" Date: Fri, 10 Oct 2003 13:43:15 +0000 Subject: [PATCH] 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 --- .../exthandler/nsExternalHelperAppService.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp b/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp index 06c5af1bdac..f8a633145d9 100644 --- a/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -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 url = do_QueryInterface(uri); if (url) {