Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-20658

Wrongly redirected to mobile SA when booting the legacy kernel

    XMLWordPrintable

    Details

      Description

      If the mobile redirector is enabled, the instantiation of the legacy kernel might generate a redirection depending on the user-agent.
      This happens for instance when using the REST API v2 if the user agent string contains http and this is due to the introduction of the legacy IO handler that needs the legacy kernel to be instantiated.

      http --auth admin:publish -v http://ezpublish5.rhel61.qa.ez.local:8080/api/ezp/v2/content/typegroups/2/types 'User-Agent: http'
      GET /api/ezp/v2/content/typegroups/2/types HTTP/1.1
      Accept: */*
      Accept-Encoding: gzip, deflate, compress
      Authorization: Basic YWRtaW46cHVibGlzaA==
      Host: ezpublish5.rhel61.qa.ez.local:8080
      User-Agent:  http
      
      
      
      HTTP/1.1 302 Found
      Connection: close
      Content-Length: 284
      Content-Type: text/html; charset=UTF-8
      Date: Fri, 05 Apr 2013 08:00:06 GMT
      Location: http://ezpublish5.rhel61.qa.ez.local/iphone/api/ezp/v2/content/typegroups/2/types
      Server: Apache/2.2.15 (Red Hat)
      X-Powered-By: PHP/5.3.3
      
      <HTML><HEAD><META HTTP-EQUIV="Refresh" Content="0;URL=http://ezpublish5.rhel61.qa.ez.local/iphone/api/ezp/v2/content/typegroups/2/types"><META HTTP-EQUIV="Location" Content="http://ezpublish5.rhel61.qa.ez.local/iphone/api/ezp/v2/content/typegroups/2/types"></HEAD><BODY></BODY></HTML>
      
      

      However, if we change the user-agent header to a string not containing "http", it will work...

      http --auth admin:publish -v http://ezpublish5.rhel61.qa.ez.local:8080/api/ezp/v2/content/typegroups/2/types 'User-Agent: bla'
      GET /api/ezp/v2/content/typegroups/2/types HTTP/1.1
      Accept: */*
      Accept-Encoding: gzip, deflate, compress
      Authorization: Basic YWRtaW46cHVibGlzaA==
      Host: ezpublish5.rhel61.qa.ez.local:8080
      User-Agent:  bla
      
      
      
      HTTP/1.1 200 OK
      Cache-Control: private
      Connection: close
      Content-Type: application/vnd.ez.api.ContentTypeInfoList+xml
      Date: Fri, 05 Apr 2013 08:00:32 GMT
      Server: Apache/2.2.15 (Red Hat)
      Transfer-Encoding: chunked
      X-Powered-By: PHP/5.3.3
      
      <?xml version="1.0" encoding="UTF-8"?>
      <ContentTypeInfoList media-type="application/vnd.ez.api.ContentTypeInfoList+xml" href="/api/ezp/v2/content/typegroups/2/types">
       <ContentTypeInfo media-type="application/vnd.ez.api.ContentTypeInfo+xml" href="/api/ezp/v2/content/types/3">
        <id>3</id>
        <status>DEFINED</status>
        <identifier>user_group</identifier>
        <names>
         <value languageCode="eng-GB">User group</value>
        </names>
        <creationDate>2002-06-18T11:21:38+02:00</creationDate>
        <modificationDate>2003-03-24T09:32:23+01:00</modificationDate>
        <Creator media-type="application/vnd.ez.api.User+xml" href="/api/ezp/v2/user/users/14"/>
        <Modifier media-type="application/vnd.ez.api.User+xml" href="/api/ezp/v2/user/users/14"/>
        <remoteId>25b4268cdcd01921b808a0d854b877ef</remoteId>
        <urlAliasSchema></urlAliasSchema>
        <nameSchema>&lt;name&gt;</nameSchema>
        <isContainer>true</isContainer>
        <mainLanguageCode>eng-GB</mainLanguageCode>
        <defaultAlwaysAvailable>true</defaultAlwaysAvailable>
        <defaultSortField>PATH</defaultSortField>
        <defaultSortOrder>ASC</defaultSortOrder>
       </ContentTypeInfo>
       <ContentTypeInfo media-type="application/vnd.ez.api.ContentTypeInfo+xml" href="/api/ezp/v2/content/types/4">
        <id>4</id>
        <status>DEFINED</status>
        <identifier>user</identifier>
        <names>
         <value languageCode="eng-GB">User</value>
        </names>
        <creationDate>2002-06-18T11:21:38+02:00</creationDate>
        <modificationDate>2004-04-15T10:39:24+02:00</modificationDate>
        <Creator media-type="application/vnd.ez.api.User+xml" href="/api/ezp/v2/user/users/14"/>
        <Modifier media-type="application/vnd.ez.api.User+xml" href="/api/ezp/v2/user/users/14"/>
        <remoteId>40faa822edc579b02c25f6bb7beec3ad</remoteId>
        <urlAliasSchema></urlAliasSchema>
        <nameSchema>&lt;first_name&gt; &lt;last_name&gt;</nameSchema>
        <isContainer>false</isContainer>
        <mainLanguageCode>eng-GB</mainLanguageCode>
        <defaultAlwaysAvailable>true</defaultAlwaysAvailable>
        <defaultSortField>PATH</defaultSortField>
        <defaultSortOrder>ASC</defaultSortOrder>
       </ContentTypeInfo>
      </ContentTypeInfoList>
      
      

      HTTPie uses this as default user-agent : "HTTPie/0.3.1"

      I know for sure that this was not a problem in a older build: ezpublish5-ee-bul-tarballs- - - - - - - - build #320 Feb 11, 2013 11:03:26
      Not sure when exactly when the problem was introduced, but late last week ( 25th or 26th of April maybe ) it was not working anymore.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                vidar.langseid@ez.no Vidar Langseid
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days
                  2d