Issue Details (XML | Word | Printable)

Key: JRA-13791
Type: Third-party issue Third-party issue
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Andreas Knecht [Atlassian]
Votes: 24
Watchers: 30
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
JIRA

Can't create issue in Safari 3 on Leopard

Created: 21/Oct/07 08:13 PM   Updated: 18/Nov/08 06:05 AM
Component/s: UI / Usability, Web interface
Affects Version/s: 3.11
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive Safari3JIRApatch.zip (19 kB)
2. Zip Archive SafariLeopardFilterPatch.zip (2 kB)

Environment: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-us) AppleWebKit/523.10.3 (KHTML, like Gecko) Version/3.0.4 Safari/523.10
Issue Links:
Duplicate
 
Reference
 

Participants: Alexander Kellett, Alexey Efimov, Andreas Knecht [Atlassian], Anton Mazkovoi [Atlassian], Brad Baker [Atlassian - JIRA BugMaster], Bradley Wagner, Brian Lane [JIRA Product Manager], Colin Madere, Craig Temple, David D. Kilzer, Eric Trepanier, Finlay Dobbie, Guillaume Boudreau, Ken Roland, Murthy Parthasarathi, Myra , sdt and Zacharias J. Beckman
Since last comment: 32 weeks, 3 days ago
Resolution Date: 17/Nov/08 06:16 PM
Labels: bug multipart pell safari webwork


 Description  « Hide
Safari 3 on Leopard has a bug where it adds a Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryiSYJ0Lax1tMirv7S request header to a HTTP GET, following the re-direct after creating an issue. JIRA's multipart library can't handle this as it is not part of the HTTP spec, and it doesn't make sense to include this header in a HTTP GET.

As a result, users see the following error:
HTTP Status 404 - No view for result [error] exists for action [ViewIssue]

We may provide a patch for our multipart library if this starts to affect a lot of users, however it is ultimately a bug in Safari.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
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:
  1. Rename all the *.class files included in the patch to *.BACKUP in your JIRA installation
  2. Extract all the *.class files from the patch into the appropriate directories (the directories that they're in, in the zip file) in your JIRA installation
  3. I included a full jira-application.properties file in the patch, however you only need to add the last few lines to your WEB-INF/classes/jira-application.properties file:
    # This property is a workaround for http://jira.atlassian.com/browse/JRA-13791.  If this property is set to true,
    # JIRA will only try to handle multipart POSTs.  Multipart GETs will be ignored by the mulipart request handler.
    # By default, JIRA will also try to handle multipart GETs however, this may lead to a problem due to a bug in Safari,
    # where a GET may be submitted with the multipart content-type header even though it isn't needed.
    jira.disable.multipart.get.http.request=true
  4. Restart JIRA for the changes to take effect

Andreas Knecht [Atlassian] added a comment - 23/Oct/07 09:06 PM
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.

Finlay Dobbie added a comment - 28/Oct/07 05:36 AM
Do you have an Apple Bug ID or WebKit bug number for this issue?

Andreas Knecht [Atlassian] added a comment - 28/Oct/07 05:23 PM - edited
Update from apple:

this bug report is confidential for the time being. So, he won't be
able to browse it. But I'll let you know if I see significant progress.


Bradley Wagner added a comment - 29/Oct/07 01:17 PM
My experience was that despite the fact that I got this error, the issue was still created successfully. Also ran into this during editing.

sdt added a comment - 29/Oct/07 02:04 PM
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?


Andreas Knecht [Atlassian] added a comment - 29/Oct/07 05:35 PM
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.


Murthy Parthasarathi added a comment - 04/Nov/07 02:41 AM
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..


Eric Trepanier added a comment - 05/Nov/07 12:57 PM - edited
Never mind my comment. I didn't get the full comment thread initially when landing here from the Google search...

Craig Temple added a comment - 09/Nov/07 12:30 PM
Any chance for a patch for 3.6?

Alexey Efimov added a comment - 09/Nov/07 12:48 PM
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>
...

Myra added a comment - 12/Nov/07 06:04 PM
Is there a patch for 3.5.3? Thanks.

Andreas Knecht [Atlassian] added a comment - 12/Nov/07 06:52 PM
I've attached a compiled version of the SafariLeopardBugFixFilter Alexey provided (thanks!).

To deploy this patch, unzip the attached SafariLeopardFilterPatch.zip file into your <JIRA-ROOT-DIR>/atlassian-jira/WEB-INF/ directory. Once you've done this, you need to edit <JIRA-ROOT-DIR>/atlassian-jira/WEB-INF/web.xml:

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


Myra added a comment - 13/Nov/07 02:48 PM
Worked for me, thanks!

David D. Kilzer added a comment - 21/Nov/07 05:11 AM - edited
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>


Alexander Kellett added a comment - 30/Nov/07 04:45 AM - edited
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?

Andreas Knecht [Atlassian] added a comment - 01/Dec/07 06:45 PM
Hi Alexander,

We already have . JIRA 3.12 (which is due to ship in the next week), already has this fix included and enabled by default.

Cheers,
Andreas


Colin Madere added a comment - 22/Jan/08 10:12 PM
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)


Anton Mazkovoi [Atlassian] added a comment - 23/Jan/08 11:05 PM
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:
http://support.atlassian.com

Cheers,
Anton


Ken Roland added a comment - 06/Mar/08 10:55 AM - edited
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?


Brad Baker [Atlassian - JIRA BugMaster] added a comment - 13/Mar/08 06:27 PM

But we do get it on Safari Beta 3.1.5525.9

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?


Ken Roland added a comment - 18/Mar/08 03:47 PM - edited
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.


Anton Mazkovoi [Atlassian] added a comment - 19/Mar/08 12:04 AM
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:
http://support.atlassian.com

I would really like to get to the bottom of this one.


Ken Roland added a comment - 24/Mar/08 10:19 AM
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.

Alexey Efimov added a comment - 25/Mar/08 05:51 AM
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;
        }
    }
}

Zacharias J. Beckman added a comment - 14/May/08 10:08 PM
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
2. Edit web.xml (in /usr/local/jira/atlassian-jira/WEB-INF) and add the two sections noted above:

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

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!


Guillaume Boudreau added a comment - 03/Sep/08 02:43 PM
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


Brian Lane [JIRA Product Manager] added a comment - 17/Nov/08 06:16 PM
The webkit issue as been marked as invalid and reports are that it has been addressed with 10.5.4+

Brian Lane
JIRA Product Manager


Guillaume Boudreau added a comment - 18/Nov/08 06:05 AM
(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.