[haiku-bugs] Re: [Haiku] #10820: W+ can't download file, goes to login.php instead

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Mon, 28 Jul 2014 16:32:33 -0000

#10820: W+ can't download file, goes to login.php instead
----------------------------------------+----------------------------
   Reporter:  ttcoder                   |      Owner:  pulkomandy
       Type:  bug                       |     Status:  new
   Priority:  normal                    |  Milestone:  R1
  Component:  Applications/WebPositive  |    Version:  R1/Development
 Resolution:                            |   Keywords:
 Blocked By:                            |   Blocking:
Has a Patch:  0                         |   Platform:  All
----------------------------------------+----------------------------

Old description:

> 1.3.1 in 47209
>
> Downloads work fine in public sites... But when there is a (cookie based)
> login wall, file download fails to work in both cases I tested:
> webmail.free.fr and keepandshare.com (that latter one allows free sign up
> I think).
>
> For instance say I'm reading my webmail, and one email has an
> attachement, which I click : instead of getting the file, webpositive
> instead downloads a login.php file (of MIME type application/xhtml+xml if
> that matters). It seems the authentication cookie is not propagated in
> that case. Other use-cases work (e.g. clicking on the "next page" in
> webmail works, I'm not redirected to the login page).

New description:

 1.3.1 in 47209

 Downloads work fine in public sites... But when there is a (cookie based)
 login wall, file download fails to work in both cases I tested:
 webmail.free.fr and keepandshare.com (that latter one allows free sign up
 I think).

 For instance say I'm reading my webmail, and one email has an attachement,
 which I click : instead of getting the file, webpositive instead downloads
 a login.php file (of MIME type application/xhtml+xml if that matters). It
 seems the authentication cookie is not propagated in that case. Other use-
 cases work (e.g. clicking on the "next page" in webmail works, I'm not
 redirected to the login page).

--

Comment (by pulkomandy):

 Ok, I tested this with keepandshare.com (the free account lasts 15 days, I
 hope this will be enough). Here is my interpretation of the problem:
 * We start the request as if we were about to load a new page, but then
 decide it's going to be a download instead.
 * FrameLoaderClientHaiku::convertMainResourceToDownload is called with the
 existing request (properly configured with all the needed data)
 * This ultimately calls WebDownloadPrivate constructor with said request
 as an argument.
 * WebDownloadPrivate creates a new ResourceHandle from that request.

 At some point in this, or perhaps a bit later, the cookies for the request
 get lost. So the "good" initial request ends up not being used (only the
 headers are parsed), and the request we attempt to use for downloading
 lacks the cookies, which obviously makes it redirect to the login page.

--
Ticket URL: <https://dev.haiku-os.org/ticket/10820#comment:5>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: