- changed status to resolved
Page refresh issue, need to open the page manually again
Hello,
After Disabling/Enabling the monitoring of a task, page refresh is not working on the browser (tested on Firefox).
Firefox showing a popup saying that it must resend the information sent before.
So refreshing functionality is not working after any post request !
If we click on try again button we see the 403 forbidden page with cookie check failed. If we click on Cancel button we see an empty page or Firefox goes into offline mode. I send images, for popup, for cookie validation field 403 forbidden.
The problem is that after clicking enable/disable button, monit makes a POST request. Webpage rendered after post request cannot be refreshed normally…
Solution is to redirect the page after the post request with response code 303 (known as Post/Redirect/Get, described here: https://en.wikipedia.org/wiki/Post/Redirect/Get).
Otherwise instead of refreshing the page with http-equiv=”REFRESH”, it can be done via javascript by:
window.location = window.location.href;
Comments (8)
-
repo owner -
repo owner Fixed: Issue
#1009→ <<cset 99339e54ecf7>>
-
Hello Tildeslash,
I build monit myself from the repository,
but I get no data via the monit command line, only "cannot parse response".I think the response status 302 can not handled propper by src/http/client.c. After I removed
#1009from src/http/cervlet.c, every thing works well again.For your information only,
with regards,
Lutz -
repo owner fix issue
#1009(handle redirect)→ <<cset a90338e9ce7c>>
-
repo owner Issue
#597was marked as a duplicate of this issue. -
Hello,
sorry, but the error response handling is stil broken with 5.30.0.For something like
monit status unknownI got a response with something like this
<html><head><title>400 Bad Request</title></head><body bgcolor=#FFFFFF><h2>Bad Request</h2>Service 'unknown' not found<hr><a href='http://mmonit.com/monit/'<font> size=-1>monit 5.30.0</font></a></body></html>
But the used header said (in “client.c”, see “_parseHttpResponse”)
HTTP/1.0 302 Moved Temporarily
Therefore, the status is 302 and not 400 and the response will not parsed properly (based on “status < 300 || status == SC_MOVED_TEMPORARILY”).
I checked “send_error“ (in “processor.c”) but can not find where the 302 came from, sorry.
With regards,
Lutz -
Hello again,
the problem come from “doPost” (in “cervlet.c”).A 302 header will append to the response all the time, see “set_status(res, SC_MOVED_TEMPORARILY);“
This will not fit to the 400 sent in the body created by “send_error“ (in “processor.c”), I think.
With regards,
Lutz
-
repo owner Command error handling does not work well. See issue
#1009additional information about the little glitch and issue#1025for a suggested fix.→ <<cset 222ca64c3a44>>
- Log in to comment
Fix
#1009Redirect back to the same url so a reload in the browser does not perform a POST again→ <<cset 89a7a0ff3341>>