Closed websolete closed 5 months ago
Current test suite passes. Will add prc specific testing before release. Merging this PR. Thanks Kevin!
Similar to how the current rc scope works, add a prc scope which behaves similarly but is not subject to population by any user input. Data stored in the prc scope can only have been added by the application itself and can be considered 'safe' to read and modify as it is never the result of anything other than application code.
Great idea. Just like Coldbox. Maybe we could introduce the event object argument etc, with all the associated helper methods.
Hi Guys
I was talking to Sean Corfield, a few months ago about adding a backward compatible enhancement to the redirect()
method:
https://cfml.slack.com/archives/C06TA3B3L/p1709743825550009
Here is the gist of my idea:
I have created a redirect:
variables.fw.redirect(action='question.form',append="questionid");
Which displays:
https://www.foo.com/question/form/questionid/31
But I also have a route:
generateSES = true,
SESOmitIndex = true,
routes = [
{"$*/question/edit/questionid/([0-9]+)/?$" = "/question/form/questionid/\1"},
Surely, the redirect() & buildURL() methods, should add the route conversion as well? So, I would expect the following to be displayed in the address bar:
https://www.foo.com/question/edit/questionid/31
Have I uncovered a bug, or maybe these methods do not analyze the routes, when converting links into SES links.
And Sean replied:
Routing is unidirectional: it's applied inbound on requests, not outbound on responses (so redirect() and buildURL() do not consider route mappings).
It's an interesting potential enhancement -- but no one's maintaining FW/1 these days so it is very unlikely to get added, unless you decide to implement it and submit a PR.
New signature:
This is what I reckon the new signature for the redirect()
method could be:
public void function redirect(
string action,
string preserve = “none”,
string append = “none”,
string path = see below,
any queryString = ‘’,
string statusCode = ‘302’,
string header = ‘’,
boolean applyRoute = false
)
So the new param would be applyRoute
Similar to how the current rc scope works, add a prc scope which behaves similarly but is not subject to population by any user input. Data stored in the prc scope can only have been added by the application itself and can be considered 'safe' to read and modify as it is never the result of anything other than application code.