|
[
Permalink
| « Hide
]
Andreas Knecht [Atlassian] added a comment - 23/Oct/07 09:05 PM
I've attached a patch that should fix this issue for Safari3 users on Leopard. The patch works with JIRA 3.10-3.11. To install:
I'll leave this issue open until the Safari 3 bug on Leopard has been resolved. The patch provided in this issue is really only a workaround for the Safari bug.
Do you have an Apple Bug ID or WebKit bug number for this issue?
Update from apple:
My experience was that despite the fact that I got this error, the issue was still created successfully. Also ran into this during editing.
Note that this doesn't just affect new issues, but also changes to existing issues including editing issues or workflow transitions. But, as Bradley stated, the effect for me is that the change has been correctly applied, it's only the immediate appearance of the updated issue that fails.
Now that Leopard is officially out, this is likely to affect a much larger number of users. Thanks for providing the workaround. Are there any concerns applying this? We've already had one customer who applied the patch successfully on JIRA 3.10 Enterprise, so there shouldn't be any issues.
And yes, you're correct, the underlying action (i.e. Creating an issue, workflow transition) will be carried out correctly. The problem is simply that the browser won't get re-directed to the appropriate view after the action has completed. We are a 100% mac organization and we are currently moving to leopard gradually. I have already been hit by this issue.
Thanks for the patch.. Will get my admins to update it. Hope apple fixes this issue.. Never mind my comment. I didn't get the full comment thread initially when landing here from the Google search...
Any chance for a patch for 3.6?
package com.acme.jira.web; import javax.servlet.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import java.io.IOException; /** * This filter fixed error * http://jira.atlassian.com/browse/JRA-13791 * * @author Alexey Efimov */ public class SafariLeopardBugFixFilter implements Filter { public void init(FilterConfig filterConfig) throws ServletException { } public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { if (servletRequest instanceof HttpServletRequest) { HttpServletRequest request = (HttpServletRequest) servletRequest; String userAgent = request.getHeader("USER-AGENT"); // For Safari on Leopard it is: // Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/523.10.3 (KHTML, like Gecko) Version/3.0.4 Safari/523.10 if (userAgent != null && userAgent.indexOf("Safari") > 0 && userAgent.indexOf("Version/3.0.4") > 0) { String type = request.getContentType(); if ("GET".equals(request.getMethod()) && type != null && type.startsWith("multipart/form-data")) { servletRequest = toNullableContentTypeRequest(request); } } } filterChain.doFilter(servletRequest, servletResponse); } private HttpServletRequest toNullableContentTypeRequest(HttpServletRequest delegate) { return new NullableContentTypeHttpServletRequest(delegate); } public void destroy() { } private static class NullableContentTypeHttpServletRequest extends HttpServletRequestWrapper { public NullableContentTypeHttpServletRequest(HttpServletRequest delegate) { super(delegate); } public String getHeader(String s) { if ("Content-Type".equalsIgnoreCase(s)) { return null; } return super.getHeader(s); } public String getContentType() { return null; } } } Add follow in web.xml: ...
<!-- Fix for Safari 3.0.4 -->
<filter>
<filter-name>SafariLeopard</filter-name>
<filter-class>com.acme.jira.web.SafariLeopardBugFixFilter</filter-class>
</filter>
...
<filter-mapping>
<filter-name>SafariLeopard</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
...
I've attached a compiled version of the SafariLeopardBugFixFilter Alexey provided (thanks!).
To deploy this patch, unzip the attached SafariLeopardFilterPatch.zip ..
<!-- Fix for Safari 3.0.4 -->
<filter>
<filter-name>SafariLeopard</filter-name>
<filter-class>com.atlassian.jira.web.filters.SafariLeopardBugFixFilter</filter-class>
</filter>
...
<filter-mapping>
<filter-name>SafariLeopard</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
...
This fix should be compatible with pretty much any version of JIRA! This bug has been reported in the open source WebKit project here:
http://bugs.webkit.org/show_bug.cgi?id=16082 The Radar bug number is: <rdar://problem/5554133> The issue is in Leopard, given that 10.5.1 came out just a short while ago I think it really unlikely that a fix from Apple will be seen in any less than a month or so.
Could Atlassian please consider applying this workaround to the next stable release? Hi Alexander,
We already have Cheers, We applied patch and are at 3.12.1, and this still occurs for me when I create issues.
Is it included but not on by default maybe? (I'm not the admin, but can get with him if need be) Colin,
The is no need to apply the patch for JIRA 3.12 or later, as JIRA 3.12 contains the actual fix. If you are having troubles with this xplease create a support request in our support system: Cheers, We are not getting this issue on 3.11 Safari 3.04 on Leopard. But we do get it on Safari Beta 3.1.5525.9
[EDIT] Went to install the patch and see that we are already using it. So perhaps this is a new issue with Safari Beta?
We would like to do some testing to pre-empt future Safari problems however we are unable to "find" this 3.1 Beta of Safari. Can you please point out how one would get this version of Safari? Is it on a Leopard beta OS release perhaps? WebKit nightly download? ADC download? Other? Sorry wasn't watching the issue. But found it again when we were having more issues. I believe this beta release is an ADC download. I don't have it myself.
[EDIT] Safari 3.1 was released today and can be obtained from the download page on Apple. It has the same issues as the Beta release did. Ken,
We have downloaded Safari 3.1 today and were not able to reproduce the problem, we were able to creating issues without problems. Would you mind creating a support request in our support system about this problem: I would really like to get to the bottom of this one. Starting a support thread now. FYI We have no problems with Safari 3.1 on Windows. Only on Mac. Backed out this modification and it did not resolve the issue.
To enable work Safari for all version please change filter code to this one:
package com.acme.jira.web; import javax.servlet.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import java.io.IOException; /** * This filter fixed error * http://jira.atlassian.com/browse/JRA-13791 * * @author Alexey Efimov */ public class SafariLeopardBugFixFilter implements Filter { public void init(FilterConfig filterConfig) throws ServletException { } public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { if (servletRequest instanceof HttpServletRequest) { HttpServletRequest request = (HttpServletRequest) servletRequest; String userAgent = request.getHeader("USER-AGENT"); // For Safari on Leopard it is: // Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/523.10.3 (KHTML, like Gecko) Version/3.0.4 Safari/523.10 // or // Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_2; en-us) AppleWebKit/525.13 (KHTML, like Gecko) Version/3.1 Safari/525.13 if (userAgent != null && userAgent.indexOf("Safari") > 0) { String type = request.getContentType(); if ("GET".equals(request.getMethod()) && type != null && type.startsWith("multipart/form-data")) { servletRequest = toNullableContentTypeRequest(request); } } } filterChain.doFilter(servletRequest, servletResponse); } private HttpServletRequest toNullableContentTypeRequest(HttpServletRequest delegate) { return new NullableContentTypeHttpServletRequest(delegate); } public void destroy() { } private static class NullableContentTypeHttpServletRequest extends HttpServletRequestWrapper { public NullableContentTypeHttpServletRequest(HttpServletRequest delegate) { super(delegate); } public String getHeader(String s) { if ("Content-Type".equalsIgnoreCase(s)) { return null; } return super.getHeader(s); } public String getContentType() { return null; } } } I tried to install the patch on our 3.11 JIRA (the precompiled one in SafariLeopardFilterPatch.zip) but this did not solve the problem. The instructions are a little bit light, so I'm not 100% certain I installed it correctly.
Steps followed where: 1. Unzip the file into /usr/local/jira/atlassian-jira/WEB-INF
Does it matter where in the file these lines are added? Can anyone think of a reason why the fix did not work? Unfortunately, our support contract expired and we aren't renewing anytime soon – at least not until there is a "serious need" and apparently this is not serious enough. (We missed the 3.12 upgrade by a couple of weeks... aiigh!) Help is much appreciated. Thank you! Note that this issue also affect Chrome, which is (currently) based on WebKit 525.13
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13 The webkit issue as been marked as invalid and reports are that it has been addressed with 10.5.4+
Brian Lane (The Webkit issue was marked invalid because it's not a Webkit bug, but a Safari bug which was indeed fixed by a Safari patch release.)
Chrome should also be fixed in the next release, as a fix for this issue was committed recently in the Chromium code base. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||