Stack Overflow has seen a multitude of inquiries related to apostrophes in form fields, particularly concerning unencoded values. An insightful post sheds light on the limitations of using encodeURIComponent(str) for handling apostrophes and suggests creating a custom function instead:
function rfc3986EncodeURIComponent (str) {...
However, my issue arises when attempting to encode the apostrophe (%27) in a value for an AJAX call from JavaScript – I consistently receive a 403 Forbidden error. This error is immediate upon response from Tomcat (8.5), indicating no application processing occurring on the server.
The following scenarios illustrate this challenge:
./application/processSomeAction.action?encodedValue=abc%27 Results in a 403 Error.
./application/processSomeAction.action?encodedValue=abc%2a Processes fine.
./application/processSomeAction.action?encodedValue=abcd Processes fine.
Notably, the AJAX call is written in pure JavaScript without reliance on JQuery.
Does this suggest that RFC 3986 sub-delimiters are prohibited in AJAX calls?