diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java index f6b002069b9..098e370c526 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/appserver/ERXApplication.java @@ -1422,28 +1422,34 @@ public void run() { } } - /** - * Creates the request object for this loop. Calls _createRequest(). For WO - * 5.3. - */ - @Deprecated - public WORequest createRequest(String aMethod, String aURL, String anHTTPVersion, NSDictionary someHeaders, NSData aContent, NSDictionary someInfo) { - return _createRequest(aMethod, aURL, anHTTPVersion, someHeaders, aContent, someInfo); - } - - /** - * Creates the request object for this loop. Calls _createRequest(). For WO - * 5.4. - */ @Override - public WORequest createRequest(String method, String aurl, String anHTTPVersion, Map> someHeaders, NSData content, Map someInfo) { - return _createRequest(method, aurl, anHTTPVersion, (someHeaders != null ? new NSDictionary(someHeaders, true) : null), content, (someInfo != null ? new NSDictionary(someInfo, true) : null)); + public WORequest createRequest(String aMethod, String aURL, String anHTTPVersion, Map> someHeaders, NSData aContent, Map someInfo) { + // Workaround for #3428067 (Apache Server Side Include module will feed + // "INCLUDED" as the HTTP version, which causes a request object not to + // be created by an exception. + if (anHTTPVersion == null || anHTTPVersion.startsWith("INCLUDED")) { + anHTTPVersion = "HTTP/1.0"; + } + + // Workaround for Safari on Leopard bug (post followed by redirect to GET incorrectly has content-type header). + // The content-type header makes the WO parser only look at the content. Which is empty. + // http://lists.macosforge.org/pipermail/webkit-unassigned/2007-November/053847.html + // http://jira.atlassian.com/browse/JRA-13791 + if ("GET".equalsIgnoreCase(aMethod) && someHeaders != null && someHeaders.get("content-type") != null) { + someHeaders.remove("content-type"); + } + + if (rewriteDirectConnectURL()) { + aURL = adaptorPath() + name() + applicationExtension() + aURL; + } + + return new ERXRequest(aMethod, aURL, anHTTPVersion, someHeaders, aContent, someInfo); } /** - * Bottleneck for WORequest creation in WO 5.3 and 5.4 to use an - * {@link ERXRequest} object that fixes a bug with localization. + * @deprecated use {@link #createRequest(String, String, String, Map, NSData, Map)} instead */ + @Deprecated protected WORequest _createRequest(String aMethod, String aURL, String anHTTPVersion, NSDictionary someHeaders, NSData aContent, NSDictionary someInfo) { // Workaround for #3428067 (Apache Server Side Include module will feed // "INCLUDED" as the HTTP version, which causes a request object not to