-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
redirect_back not work as expected as previous_url #1889
Comments
Is there any info that needs to be update for clarify? |
(Of course, I could be wrong). |
This issue has been going on for some time, please let me try to reexplain it with more details.
both output in the edit form page web | context.request.headers["Referer"] # => "http://127.0.0.1:3000/universities"
Then submit the form use PUT action, as you said in the reply, action print referer as edit page correctly output in the action request.headers["Referer"] # => "http://127.0.0.1:3000/universities/788/edit"
if operation.saved?
pp! "Print in update action", request.headers["Referer"]
flash.success = "修改成功"
> redirect_back fallback: Index, allow_external: true
else
flash.failure = "出错了"
html EditPage, operation: operation, university: updated_university
end
@matthewmcgarvey Thanks. |
My guess is maybe a bug in I'm not sure what this line is doing lucky/src/lucky/page_helpers/url_helpers.cr Line 106 in e069903
|
Describe the bug
Please check following log:
GET /universities/788/edit
from Index page (/universities)Then submit the form use PUT action.
What i expected is to redirect to original url which is the entry for render the form use following code, But it not work
But, it not work as expected, as you can see the in above pp! log, the output of
request.headers["Referer"]
in the Update action output the/universities/788/edit
instead of expecteduniversities
(which print by the previous_url).Thanks
Expected behavior
Use
redirect_back fallback: Index, allow_external: true
to redirect back to/universities
Versions (please complete the following information):
crystal --version
): 1.12.1Additional context
I use htmx, i test with disable it, same issue.
The text was updated successfully, but these errors were encountered: