Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1990] ACS: Filters not executing with uppercase routes

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2014-01-19T22:04:20.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsconfig, node-acs
ReporterManuel Conde Vendrell
AssigneeMostafizur Rahman
Created2013-12-10T08:52:47.000+0000
Updated2016-03-08T07:40:55.000+0000

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.

Comments

  1. Mostafizur Rahman 2014-01-18

    Hello, I tested this with my sample code. I can’t reproduce this issue. It’s working as expected. I did not notice the case sensitive nature of the filters. If you have different test case that reproduces the issue, please post your sample here. For more information please visit: http://docs.appcelerator.com/cloud/latest/#!/guide/node

    Test Environment

    Mac OS X 10.8.5 Ti SDK 3.2.0.GA

    Test Code

    link: https://github.com/csemrm/NodeACSTest Thanks
  2. Manuel Conde Vendrell 2014-01-19

    Hi Mostafizur. This error only works in Ti 3.1.3GA, I've tested again the code in 3.1.3 and the error is still there. I suppose it is fixed in 3.2.0GA. Thank you for your time.

JSON Source