Your Ad Here

Patching Aggie's referrer

Inspired by Les Orchard’s patching of AmphetaDesk to fix the referrer problem, I’ve patched Aggie.

This patch will change Aggie’s behavior to conform to the HTTP specs. When Aggie requests an RSS feed, the referrer header is now blank, and if the user configured a WeblogURL in Aggie.xfg, that URL will be added to the User-Agent header.

The only changes are a few lines in AggieRequest, but I’m including the entire AggieRequest class here for convenience.

public  class AggieRequest {
   private const int defaultTimeout_ = 60000;
   private const string aggieBase_ = @"http://bitworking.org/AggieReferrers.html";
   private static string referer_ = "";
   private static string userAgent_ = VersionInfo.UserAgent
      + " (" + Environment.OSVersion.ToString() + "; .NET CLR " 
      + Environment.Version.ToString();
   
   public static string WeblogUrl {
      set { 
         if (null != value && String.Empty != value) {
            userAgent_ = "; From: userAgent_ + value + ")"; 
         } else {
            userAgent_ = userAgent_ + ")"; 
         }
      }
   }
   
   public static HttpWebRequest CreateRequest(string url) {
      WebRequest req = WebRequest.Create(url);
      HttpWebRequest wreq = req as HttpWebRequest;
      if (null != wreq) {
         wreq.UserAgent = userAgent_;
         wreq.Referer =  referer_;
         wreq.Timeout = defaultTimeout_;
      }
      return wreq;
   }         
}

This patch is released under the same licensing terms as Aggie itself, which if I remember correctly is the MIT License.

I’ve compiled Aggie 1.0 RC4 with this patch using SharpDevelop and it works for me. No guarantees are made that it will work for you, although I can’t think of any reason why it wouldn’t.

Adam Kalsey
February 4, 2003 8:54 AM

Aggie’s developer writes in: “I have moved the referrer URL to be appended to the UserAgent field instead of the Refererrer field. This change is currently in CVS and will be in RC5 when it is released.”

Excellent.

Trackback from Mentalized
March 19, 2003 8:19 AM

Bogus referrers

Excerpt: My referrerlogs are being polluted. Popdex, Organica, Technorati and others seem to not care about the HTTP specification and are...


Your comments:

Text only, no HTML. URLs will automatically be converted to links. Your email address is required, but it will not be displayed on the site.

Name:

Email: (not displayed)

If you don't feel comfortable giving me your real email address, don't expect me to feel comfortable publishing your comment.

Website (optional):

Lijit Search

Best Of

Recently Read

Get More

Subscribe | Archives

Recently

Sprout Test (May 7)
A test post for Sprout widgets.
Product Leadership (May 3)
An anthology of product leadership writing.
Fighting Monster patent claims (Apr 16)
The patent bully picked on the wrong little guy.
Peavy's pine tar (Apr 6)
Jake Peavy's cheating
Bush and Morgan on inner city baseball (Mar 30)
Morgan and Bush discuss the role of baseball in the inner cities.
Not a fork (Mar 27)
We have no intention of forking Drupal. That would be nuts. So what are we doing then?
Eating our dogfood in the sausage factory (Mar 26)
Recursive development for the new Drupal powered community platform.

Subscribe to this site's feed.

Elsewhere

Feed Crier
Get alerted by IM when your favorite web sites and feeds are updated.
SacStarts
The Sacramento technology startup community.
Pinewood Freak
Pinewood Derby tips and tricks
Del.icio.us
My tagstream at del.icio.us.
Waddlespot
My son's Club Penguin community. News, blogs, tips, and tricks.

Contact

Adam Kalsey

Mobile: 916.600.2497

Email: adam AT kalsey.com

AIM or Skype: akalsey

Resume

PGP Key

©1999-2008 Adam Kalsey.
Content management by Movable Type.