-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Case sensitivity #10
Comments
Hi Simon,
We are looking at removing the TO_LOWER in the full rebuild of CoreLogic, but I think the TO_LOWER would then be replaced by SET_TEXT_MODE(IGNORECASE), giving the same result. Does that make sense to you? Cheers, |
Hi Jan, Thanks for explanation. So the main point is: should URL paths with different casing be treated as unique ressources, or are they different. As most webservers running on linux differentiates those paths I would say they shouldn't be treated the same. In our setup we do also have an appfw before the ADC which works case sensitive. So in our setup almost everthing works case sensitive except core logic. FYI: The TO_LOWER or even the planned SET_TEXT_MODE(IGNORECASE) in CoreLogic wouldn't be really necessary in most cases, because the usage of HTTP.REQ.HOSTNAME within the expression sets the text_mode to case insensitive implicitly. It took me quite a while to figure this out. See https://developer-docs.citrix.com/projects/citrix-adc-advanced-policy-expression-reference/en/latest/http_req_t/. Cheers, |
What I meant in my second post, is that there will/should never be two endpoints at the same URL which differ only by case, for example: The above would be bad API design in my opinion. That brings us back to case-sensitivity, I've checked the link you provided.
To make sure the IS_STRINGMAP_KEY function returns To summarize, Of course, we don't touch the information in the request, so if the backend webserver is case-sensitive, the request would still fail. So allow me to turn the question back to you; how would you suggest to handle it?
Don't get me wrong I'm definitely willing to change the behaviour, but it needs to be tested throughly 😄 |
Hi Jan, Variant A Variant B
The logic then has then to respect these settings. So imho if a user misspells a URL which is configered explicitly case sensitive by the admin it should simply route to NOTFOUND. But this change would almost double the code of CoreLogic, and could also doubles the amount of lookups needed for each request. So feel free to take this as feature request for the next version, but I would also understand if you decide to leave it that way. It is quite a lot of work for a relatively small feature. In our case: We already branched CoreLogic and did quite some modifications over the time (use X-Forwarded-For instead of the client IP, added some logic for special routing for authenticated users, custom error pages), so we have to address the case sensitivity in our own code. I think we would go with variant A. Cheers, |
Hi Simon, I'll have to investigate what it means for the code to support both modes of operation (as the package engine isn't flexible in that regard in the way we have to define/develop expressions). It might double or even triple the amount of code required. However, my biggest fear is that it will be more cumbersome to troubleshoot. The strength in the current code is that it just works, always (if your input as an administrator is correct, obviously). If it is too much of a hassle, I would opt for the case-sensitive mode (with the addition that we can enable a redirect if we find an entry that resembles the failed request, i.e., the different casing of the request). Would you be willing to share the changes you made, so I can see whether it is in the general interest to have them included in the public version? There are already many changes and improvements coming in the new release, so taking on some other stuff might be simple. |
Hi,
Is there a specific reason why the stringmap matching in CoreLogic works NOT case sensitive? If the backend server treats paths case sensitive this could be unwanted behaviour to pass requests through.
`
FULL - LAN
add policy expression PE_CL1009_HTTP_CS_FULL_LAN_KEY "(HTTP.REQ.CS_VSERVER.NAME + ";lan;" + HTTP.REQ.HOSTNAME.SERVER + HTTP.REQ.URL.PATH).TO_LOWER"
add policy expression PE_CL1009_HTTP_CS_FULL_LAN_KEY_EXISTS "((HTTP.REQ.CS_VSERVER.NAME + ";lan;" + HTTP.REQ.HOSTNAME.SERVER + HTTP.REQ.URL.PATH).TO_LOWER.IS_STRINGMAP_KEY("SM_CL1009_CS_CONTROL"))"
add policy expression PE_CL1009_HTTP_CS_FULL_LAN_VALUE_DST "(HTTP.REQ.CS_VSERVER.NAME + ";lan;" + HTTP.REQ.HOSTNAME.SERVER + HTTP.REQ.URL.PATH).TO_LOWER.MAP_STRING("SM_CL1009_CS_CONTROL").AFTER_STR("dst=").BEFORE_STR(";")"
add policy expression PE_CL1009_HTTP_CS_FULL_LAN_VALUE_VS "(HTTP.REQ.CS_VSERVER.NAME + ";lan;" + HTTP.REQ.HOSTNAME.SERVER + HTTP.REQ.URL.PATH).TO_LOWER.MAP_STRING("SM_CL1009_CS_CONTROL").AFTER_STR("vs=").BEFORE_STR(";")"
add policy expression PE_CL1009_HTTP_NO_SERVICE_SWITCH_FULL_LAN_KEY_EXISTS "((HTTP.REQ.CS_VSERVER.NAME.BEFORE_STR_ANY("PS_CL1009_NAME_PROTOCOLS") + "_ssl;lan;" + HTTP.REQ.HOSTNAME.SERVER + HTTP.REQ.URL.PATH).TO_LOWER.IS_STRINGMAP_KEY("SM_CL1009_CS_CONTROL"))"
`
Do you see any problems if we try to change our CoreLogic to case sensitive? It seems that the multiple TO_LOWER expressions are the only thing to remove.
Thanks,
Simon
The text was updated successfully, but these errors were encountered: