If you’re a web-developer, you probably came across the pretty useful Firefox add-on „LiveHTTPHeaders„, which allows you to monitor, replay and even modify the headers your browser sends to the webserver. Unfortunately, there’s been a bug in it for now more than a year that prevents you from modifying HTTP POST requests – you always get a „Request entity too large!“ response, due to duplicate Content-Type headers.
After having to patch the add-on for several times, (because every „new“ version of LiveHTTPHeaders breaks it again, which doesn’t happen too often, fortunately) I decided to upload a quick fix for this problem.

Step 1: navigate to the Firefox LiveHTTPHeaders add-on folder, which is C:\ Documents and Settings\ [username].[domain]\ Application Data\ Mozilla\ Firefox\ Profiles\ [random].default\ extensions\ {8f8fe09b-0bd3-4470-bc1b-8cad42b8203a}\ chrome for Windows XP
Step 2: now, you have three options…

  • The simple way: Replace your livehttpheaders.jar (v0.14) file with this one.
  • The complex way: Open the livehttpheaders.jar with WinRAR (or similar) and replace the file /content/LiveHTTPHeaders.js with this one. That way you’ll keep any additional changes you made to the add-on. Plus, this fix should work for future versions, too.
  • The do-it-yourself way: Open the livehttpheaders.jar, extract the /content/LiveHTTPHeaders.js and replace the following lines:
    – find: req[header[1]]=header[2];
    – replace with: if (!header[1].match(/^(Content-Length)$/)) req[header[1]]=header[2];
    – find: if (‚Content-Type‘ in req)
    – replace with: //if (‚Content-Type‘ in req)
    – find: post.addHeader(‚Content-Type‘, req[‚Content-Type‘]);
    – replace with: // post.addHeader(‚Content-Type‘, req[‚Content-Type‘]);
    Save the file, copy it back in to the .jar archive and you’re done.

Step 3: Restart your Firefox. Enjoy the fixed POST function, plus you don’t need to update the Content-Length line anymore, the add-on will do it for you.