title: Unable to download file from private window wkwebview
body: <p>I am trying to download file from private window using wkwebview unfortunately unable to download the file. this is the response which i am getting.</p>
  
  <pre><code>-[DownloadHandler saveDirectoryPathForResponse:][L:124]response &lt;NSHTTPURLResponse: 0x600000434c20&gt; { URL: https://osxDev.slack.com/?redir=%2Ffiles-pri%2FT0B5PPLCX-FF7NT0NNA%2Fdownload%2Fchalte_chalte_-_pagalworld.org } { Status Code: 200, Headers {
      "Cache-Control" =     (
          "private, no-cache, no-store, must-revalidate"
      );
      "Content-Encoding" =     (
          gzip
      );
      "Content-Length" =     (
          19772
      );
      "Content-Type" =     (
          "text/html; charset=utf-8"
      );
      Date =     (
          "Wed, 23 Jan 2019 11:08:19 GMT"
      );
      Expires =     (
          "Mon, 26 Jul 1997 05:00:00 GMT"
      );
      Pragma =     (
          "no-cache"
      );
      Server =     (
          Apache
      );
      "Set-Cookie" =     (
          "d-s=1548241699; path=/; domain=.slack.com; secure; httponly",
          "x=eo7res6xk440uh3keb6sggrzh.1548239853; expires=Wed, 23-Jan-2019 11:23:19 GMT; Max-Age=900; path=/; domain=.slack.com"
      );
      "Strict-Transport-Security" =     (
          "max-age=31536000; includeSubDomains; preload"
      );
      Vary =     (
          "Accept-Encoding"
      );
      Via =     (
          "1.1 5c49044a9bbc82066ce04ae597e1a6a7.cloudfront.net (CloudFront)"
      );
      "referrer-policy" =     (
          "no-referrer"
      );
      "x-amz-cf-id" =     (
          "jnczFrzoTMCmf-vZHd3M7jgYfKQEl0AEltH7fl74jZE144tGU2MvCw=="
      );
      "x-cache" =     (
          "Miss from cloudfront"
      );
      "x-frame-options" =     (
          SAMEORIGIN
      );
      "x-robots-tag" =     (
          "noindex,nofollow"
      );
      "x-via" =     (
          "haproxy-www-gd85"
      );
      "x-xss-protection" =     (
          0
      );
  } }
  </code></pre>
  
  <p>But when i am trying with non-private i am able to download and response is</p>
  
  <pre><code>-[DownloadHandler saveDirectoryPathForResponse:][L:124]response &lt;NSHTTPURLResponse: 0x6040006244c0&gt; { URL: https://files.slack.com/files-pri/T0B5PPLCX-FF7NT0NNA/download/chalte_chalte_-_pagalworld.org } { Status Code: 200, Headers {
      "Accept-Ranges" =     (
          bytes
      );
      "Cache-Control" =     (
          "max-age=31536000, public"
      );
      Connection =     (
          "keep-alive"
      );
      "Content-Disposition" =     (
          "attachment; filename=\"Chalte Chalte - Pagalworld.org\"; filename*=UTF-8''Chalte%20Chalte%20-%20Pagalworld.org"
      );
      "Content-Length" =     (
          3763833
      );
      "Content-Type" =     (
          "audio/mpeg"
      );
      Date =     (
          "Wed, 23 Jan 2019 11:04:42 GMT"
      );
      Etag =     (
          "\"0c3a5aebdf8ab1acab4e098ccb77bc9a\""
      );
      Via =     (
          "1.1 b72519ee5ed84e4e3db077b5b7e93d38.cloudfront.net (CloudFront)"
      );
      "X-Amz-Cf-Id" =     (
          "aQ6auC2yu5RwLeYuEFyE3TT7tes36MTo5uGnTQ3vxXfGaZ2nAzxNJQ=="
      );
      "X-Backend" =     (
          "imgproxy-prod-pdx-lk25"
      );
      "X-Cache" =     (
          "Miss from cloudfront"
      );
      "X-Content-Type-Options" =     (
          nosniff
      );
      "X-Robots-Tag" =     (
          noindex
      );
      "X-Slack-Meta" =     (
          S3TA
      );
  } }
  </code></pre>
  
  <p>as you can see in private response which is different from non-private response and also content-disposition missing and you can also see response url is different. so in order to download the file even if the WKWebview is in private mode how to do that .</p>
  
  <p>Any suggestions?</p>