Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-1990

ACS: Filters not executing with uppercase routes

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      Windows 7 64 bits
      Titanium 3.1.3GA

      Description

      I had some filters defined in my app working well until I created a new one with an uppercase letter. This new filter is not executed at all.

      Example:

      {
        "routes":
        [
          {"path": "/", "callback": "application#index"},
          {"path": "/login", "method":"post", "callback": "useraccess#login"},
          {"path": "/logout", "callback": "useraccess#logout"},
          {"path": "/admin", "callback": "application#home"},
          {"path": "/messages", "callback": "messages#list"},
          {"path": "/changePwd", "callback": "users#changePassword"}
        ],
        "filters":
        [
          {"path": "/admin", "callback": "session_filter#validateAdmin"},
          {"path": "/admin/*", "callback": "session_filter#validateAdmin"},
          {"path": "/logout", "callback": "session_filter#validateSession"},
          {"path": "/changePwd", "callback": "session_filter#validateSession"},
          {"path": "/messages", "callback": "session_filter#validateSession"},
          {"path": "/messages/*", "callback": "session_filter#validateSession"}
        ],
      }
      

      With that code, only the filter *

      {"path": "/changePwd", "callback": "session_filter#validateSession"}

      * will not be executed.

      If I change it for *

      {"path": "/changepwd", "callback": "session_filter#validateSession"}

      * then it works (even leaving the route with the uppercase).

      This stuck me for a lot of hours until I notice that uppercase letter, making a lot of different test this the validate function instead with the config.json.

      In the docs there is no reference to this, so I suppose it is an annoying bug.

        Attachments

          Activity

            People

            • Assignee:
              mrahman Mostafizur Rahman
              Reporter:
              mcvendrell Manuel Conde Vendrell
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Integration