Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-5821

Ibexa router disables checking for headers in route conditions config

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Medium Medium
    • 4.6.0, 4.5.5
    • None
    • Open Source
    • None

    Description

      Ibexa router class Ibexa\Bundle\Core\Routing\DefaultRouter overrides the matchRequest method to enable matching on semantic path info by calling the match method.

      This effectively disables all request based condition checking in route definitions.

      For example, the following route match will not work:

      app_test:
      path: /test
      controller: App\Controller\Test
      condition: "request.headers.get('X-Custom') === 'Foo'"

      because at the point of the match, the headers do not exist in the request. At this point, the request is a dummy object created by Symfony based only on the request path (due to calling the match method in Ibexa\Bundle\Core\Routing\DefaultRouter::matchRequest)

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              f8f4635f-c125-4f25-94af-5c94e74ef8c1@accounts.ibexa.co Edi Modrić
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: