The attached patches are to fix the web server so it will accept post requests from Firefox 3. The issue is that FF3 overrides the content-type header on all post requests and sets it to 'application/x-www-form-urlencoded; charset=UTF-8' but the web server code looks for the header value 'application/x-www-form-urlencoded'. I've modified the Serve.java file to look for headers that start with the 'application/x-www-form-urlencoded' instead of equality. I also increased the maximum post request size from 10,000 bytes to 1,000,000 as some users of my SJQ plugin were hitting the 10,000 limit. The patch also includes some build.xml files, which I created to build the various required JARs outside of Eclipse. To use the Ant build files, simply install Ant and put it in the system path. A detailed description of each change in the patches is listed below:
Add new file 'build.xml': Ant build script
Serve.java:
1) Increased MAX_FORM_LENGTH const from 10,000 to 1,000,000 to allow for larger posts to the server
2) Changed check for content-type from equality to startsWith() check to allow posts from Firefox 3.
Version.java:
Just changed the version const to something unique so I knew which version of the code I was running while testing
SetupWebserver.nsi:
1) Include websrvInstallOptions.nsh instead of installOptions.nsh; the version of NSIS I installed (latest available) has an include file named installOptions.nsh, which seems to conflict at NSIS compile time. Renaming this file fixed the issue and allowed the build to complete.
2) References to \bin\net\... replaced with \build\net\... - my Ant build scripts do all the building in build rather than bin; bin dir just used for final deliverables
3) Deleted installOptions.nsh, renamed it to websrvInstallOptions.nsh; version of NSIS I installed has an include named installOptions.nsh which appeared to conflict with the version in the src tree
Add new file build.xml: Ant build script
sageutils.nsh:
References to \bin\net\... replaced with \build\net... - my Ant build scripts do all the building in build rather than bin; bin dir just used for final deliverables
Add new file build.xml: Ant build script
If nothing else is taken from this patch, I'd just like to see the Serve.java changes applied to CVS and included in the next release; the rest of the changes were just done so I could get myself a working build environment for the web server. I was able to build these changes and install them (with the installer) and am running this version now and it all works as expected. Obviously, my testing is limited, but all the basics seem to be working fine and the changes to Serve.java also work as expected.
Patches to webserver, xmlinfo and sageutils to accept post requests from Firefox 3