title: Range header broken in Drive?
body: <p>The <em>Range</em> header doesn't seem to work correctly for files downloaded via the <em>export-links</em>. These are the request headers, response headers, and top part of the content:</p>
  
  <pre><code>GET /feeds/download/documents/export/Export?id=1dU-juYN25FMXdp6Ju62KAIT_0tuuZAPEgZkj-aT6kPQ&amp;exportFormat=docx HTTP/1.1
  Host: docs.google.com
  Range: bytes=0-499
  Content-length: 0
  Authorization: Bearer ya29.1.AADtN_VJ_CVLUz30Ke0zeNnhBk19y3UPo-SAnMLK5WMXUEo9a6RiTgt_ghBZRw
  HTTP/1.1 200 OK
  Alternate-protocol: 443:quic
  X-xss-protection: 1; mode=block
  X-robots-tag: noarchive
  Content-disposition: attachment;filename="EventDrivenIOWebApplicationServerAnalysis.docx"
  Set-cookie: NID=67=AUoLJM4MRuah2izbPY5Lq_8-4bXlAlVH6N0dren6TAMFvZZo5R82VCXQvBOu9X2eIWdYf2_OeTwrq-3WH6q5uwA99CXcBDy1urLzr6fGeJUE5Pxy6EWVDG3HZLFjAz1H;Domain=.google.com;Path=/;Expires=Thu, 04-Sep-2014 05:36:12 GMT;HttpOnly
  Expires: Wed, 05 Mar 2014 05:36:12 GMT
  X-google-cache-control: remote-fetch
  Server: GSE
  Via: HTTP/1.1 GWA
  Cache-control: private, max-age=0
  Date: Wed, 05 Mar 2014 05:36:12 GMT
  P3p: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&amp;answer=151657 for more info."
  Content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document; charset=utf-8
  X-frame-options: SAMEORIGIN
  X-content-type-options: nosniff
  Content-location: https://docs.google.com/feeds/download/documents/export/Export?id=1dU-juYN25FMXdp6Ju62KAIT_0tuuZAPEgZkj-aT6kPQ&amp;exportFormat=docx
  PK¬dDdocProps/app.xmlÁ
  Â0D¿À¹kªI[Ñ«õm
  ´»!»þ½A={Þð±í}Ô
  2GÂZÏgVBÄ¾Ö§ãnºÒÅap!Ôú¬ÛfbdÀªk}IkcØ_`t&lt;+é(NJÌ½¡®¶ä¯# EU-
  Ü0@¦P¿ëü+
  ä_ûø||¤âkì&amp;¥!z'åd³'êP¥ÃÖük¾§'PKoð¬PK¬dDdocProps/core.xmlmÝJÄ0FÀw¹og« RÚ.*Â*z±ÌÉ¸mßÞlÑ*ì^ð9Ì|Íz´í1&amp;í]Ë«rÅ:év}Ë_o+Î     §ñ[&gt;aâëî¬¡&gt;âSô#iL,\ªehù(ÔIîÐTfÂåðÃG+(cAÈOÑ#¯V`$à ,Âbä?J%eøf( hÐ¢£UYÁKm:90'ÿH«i
  xý
  zLza(ÍûWðöp¿O-´;T%w5i2ØÝìóì:êü²;xd¯øÎ6!-åÒÙcîm0SÒ©T^
  ,ó
  UÝ}PKÙ)å.¶PK¬dDword/footer1.xml­TËnÛ0üþÀ»-'¢"EöbBÓ~CRk¾°¤¤øï»Ô+[Lkfgf¹^ûæöI«¤à¥59¹ÚîH"³\*'¿}Û|!Ôpª¬99On÷nº¬ ØøL³Ô!¸,M=«¦~k0H4
  øUª)·aV;ä£T2ÓëÝî3mlN0Ùh±Ñõ¶QÙ²LÇ¤5¹ä`Y£   }b
  BaÖøZ:?¹éKÝ¬'ö£K´ZMu[ÆvøMh5u¸Ë÷rv¼Ú­`´kZx9u¢©4³MÜÑ½Åìqh½ÕóEgáÕFê(Âùmôy¾Ô;¹j¨
  
  Ìy«)É@]â ,;        ~GMKçeæÕªu^8qI+ ìñ÷í.Ã¿^äd7¾Èý,àð-têº(i£Â¦+ '!Üñ°¸¥QMÒ     &gt;J#üï$·Ý5¬ZPQ4j¨zpá%ü6 «:D0Û(Ú)5\B8G~Æ¼{ñõû}|Ä²#?Qÿ4Þ¡¡èßç6þ{×³JGfuCxý_PKx÷OÛ PK¬dDword/numbering.xmlíXYnÛ0=Aï`èg¬Å²¬ AAQéh¶pÝôô¥ÖDRÐ?å|3óä£G#ßÜþælv$ ¨ãÏ=gF)ûÄùõüx;3¥H$Î+QÎíæÓÍi-r¾%`üfB¨5ÇsÐ:[»®ÂÂËcÜIàH)ì]à%Ï®°äÒtKÕ¯nàySÓÈÄÉA¬k+N1H%wºYËÝbRMÉ[&lt;Hs"tÑÂÌ¤P©Ëfäø¯M9küNÙl) 9gÎªD'   i¥úP[FßqE1f    ÝÍJ8¢¢¥)nG¨Í=7¹ëC+©Þ6òvYHez¢[@ð:\:ã&lt;ßÇgtÔ-î1(C{!Ï¡Àº!`ç00_HzÄµ9ÝºÎ=¦¢= îlÌ¯mõ÷Ï:³¯©)¥;2c¢fH¯DLÁm°#b»©ÊÅ#oÁ`Ê«L&amp;òünmýyÃ
  ÊÈNWpöÔØ
  </code></pre>
  
  <p>I should only get five-hundred bytes back (of content), per the docs ("partial download" section at <a href="https://developers.google.com/drive/web/manage-downloads" rel="nofollow">https://developers.google.com/drive/web/manage-downloads</a>).</p>
  
  <p>The <em>Range</em> header works great for normal downloads. I'll get something like this in the response:</p>
  
  <pre><code>Content-range: bytes 0-499/11406698
  </code></pre>
  
  <p>This expresses the range that was fulfilled, and the content-length.</p>