[ 
https://issues.apache.org/jira/browse/WICKET-6544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16408121#comment-16408121
 ] 

ASF GitHub Bot commented on WICKET-6544:
----------------------------------------

Github user solomax commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/269#discussion_r176132347
  
    --- Diff: 
wicket-core/src/test/java/org/apache/wicket/protocol/http/request/WebClientInfoTest.java
 ---
    @@ -680,6 +708,35 @@ public void konqueror()
                }
        }
     
    +   @Test
    +   public void ffMobile()
    +   {
    +           final String userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 
11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) FxiOS/10.6b8836 
Mobile/15D100 Safari/604.5.6";
    +           WebClientInfo webClientInfo = new 
WebClientInfo(requestCycleMock, userAgent);
    +
    +           assertThat(userAgent, 
webClientInfo.getProperties().getBrowserVersionMajor(),
    +                   is(equalTo(10)));
    +           assertThat(userAgent, 
webClientInfo.getProperties().getBrowserVersionMinor(),
    +                   is(equalTo(6)));
    +           assertThat(userAgent, 
webClientInfo.getProperties().isBrowserMozillaFirefox(),
    +                   is(equalTo(true)));
    +           assertThat(userAgent, 
webClientInfo.getProperties().isBrowserMozilla(),
    --- End diff --
    
    This part is something I don;t really like in this PR :(


> Chrome and Firefox on iOS detected as Safari version -1
> -------------------------------------------------------
>
>                 Key: WICKET-6544
>                 URL: https://issues.apache.org/jira/browse/WICKET-6544
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 7.9.0
>            Reporter: Sven Ackermann
>            Assignee: Maxim Solodovnik
>            Priority: Major
>
> The UserAgent detection on iOS for browsers other than Safari does not work 
> correctly.
> E.g. Chrome 64 has UserAgent
> ??Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) 
> AppleWebKit/604.1.34 (KHTML, like Gecko) CriOS/64.0.3282.112 Mobile/15D100 
> Safari/604.1??
> which is recognized by classes {{UserAgent}} and {{WebClientInfo}} as Safari 
> with no version (-1). The problem is that the UserAgent does not contain 
> "Chrome" as required by {{UserAgent.CHROME}}, but instead "CriOS". So it is 
> recognized as Safari, but since it does not contain "version/", no version is 
> set.
> A similar problem exists for Firefox on iOS where the UserAgent contains 
> "FxiOS" instead of "Firefox":
>  ??Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) 
> AppleWebKit/604.5.6 (KHTML, like Gecko) FxiOS/10.6b8836 Mobile/15D100 
> Safari/604.5.6??
> In our application this causes some unwanted redirects to legacy pages 
> because we think it is an old Safari browser with no support for some 
> features our pages need. But of course the Chrome und Firefox versions above 
> support all that.
> see also 
> [https://developer.chrome.com/multidevice/user-agent#chrome_for_ios_user_agent|https://developer.chrome.com/multidevice/user-agent#chrome_for_ios_user_agent,]
>  and 
> [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox#Firefox_for_iOS]
>  
> Thanks for looking into it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to