querystring.clean
Available inall subroutines.
Returns the given URL without empty parameters. Parameters are considered empty when their names are empty. Effectively, this strips a malformed query string of superfluous separators, such as a trailing ?
or extra ampersands:
/path?name=value&&=value-only&name-only
becomes/path?name=value&name-only
/path?
becomes/path
Example
set req.url = querystring.clean(req.url);
User contributed notes
BETADo you see an error in this page? Do have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact support@fastly.com)