🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.reader
Article #2763

Opening PDF in browser fails when web server protects files via "referer"

#2763
From: Martyn_Noss
Date: Mon, 08 Dec 2008 20:18
11 lines
1822 bytes
We've recently added security to our file downloads by configuring the web server (Apache) to allow downloads only when the "referer" string (one of the HTTP headers) matches our server. All non-PDF files download fine (i.e., we can download MS Office documents, text documents, etc.) in all target browsers (Firefox, Safari, IE) under this new configuration. And PDF files also work fine so long as the browser is configured to simply download the file rather than open it via the Adobe Reader plugin.

But attempting to open PDF in the browser directly (i.e., via the plugin) fails consistently: The first page of the file displays in the browser, and then the download hangs. The server simultaneously records an "access denied" (403) error. Does anyone know how come?

My only theory so far is that the plugin is attempting to fetch the file at least once after the initial download begins. The server would presumably deny this request (since the referer string wouldn't match our server), and the download would hang at this point.

Is this theory right? Or does anyone have a different theory?

Assuming we don't want to change the way we're doing security on the server, how can we work around this problem?

Any advice much appreciated.
Technical Details
Message-ID: <59b73743.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: 10273d,3a0e3fc3a7dfb2d3,start
X-Google-Attributes: gid10273d,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Martyn_Noss@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.reader
Subject: Opening PDF in browser fails when web server
 protects files via "referer"
Message-ID: <59b73743.-1@webcrossing.la2eafNXanI>
Date: Mon, 8 Dec 2008 12:18:05 -0800
Lines: 24
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit