Patching Aggie's referrer

Freshness Warning
This blog post is over 18 years old. It's possible that the information you read below isn't current and the links no longer work.

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...

This discussion has been closed.

Recently Written

The Trap of The Sales-Led Product (Dec 10)
It’s not a winning way to build a product company.
The Hidden Cost of Custom Customer Features (Dec 7)
One-off features will cost you more than you think and make your customers unhappy.
Domain expertise in Product Management (Nov 16)
When you're hiring software product managers, hire for product management skills. Looking for domain experts will reduce the pool of people you can hire and might just be worse for your product.
Strategy Means Saying No (Oct 27)
An oft-overlooked aspect of strategy is to define what you are not doing. There are lots of adjacent problems you can attack. Strategy means defining which ones you will ignore.
Understanding vision, strategy, and execution (Oct 24)
Vision is what you're trying to do. Strategy is broad strokes on how you'll get there. Execution is the tasks you complete to complete the strategy.
How to advance your Product Market Fit KPI (Oct 21)
Finding the gaps in your product that will unlock the next round of growth.
Developer Relations as Developer Success (Oct 19)
Outreach, marketing, and developer evangelism are a part of Developer Relations. But the companies that are most successful with developers spend most of their time on something else.
Developer Experience Principle 6: Easy to Maintain (Oct 17)
Keeping your product Easy to Maintain will improve the lives of your team and your customers. It will help keep your docs up to date. Your SDKs and APIs will be released in sync. Your tooling and overall experience will shine.

Older...

What I'm Reading

Contact

Adam Kalsey

+1 916 600 2497

Resume

Public Key

© 1999-2021 Adam Kalsey.