yii2mod / yii2-comments

Comments module for Yii2
MIT License
159 stars 64 forks source link

No Reason Phrase #89

Closed kwazaro closed 5 years ago

kwazaro commented 5 years ago

When I add comment sometimes appears javascript alert with message "No Reason Phrase". What is this and how can I control this?

ihorchepurnyi commented 5 years ago

I think it's a server error. Please research it in the nginx or apache, dependence on what you are you using.

kwazaro commented 5 years ago

Yii debugger shows the AJAX post request to /comment/default/create with 424 status (error message appears in browser like javascript alert("No Reason Phrase") with OK button) and comment not added. Maybe it something wrong with pjax, because I have no such errors except this module. I noticed this error on different websites using this module. I have no ability to change server configs (shared hosting), so it's hard to track this error, if it is server side.

kwazaro commented 5 years ago

Is it possible to totally disable PJAX? I think the problem caused by PJAX.

ihorchepurnyi commented 5 years ago

I think you can override comments view, so create the similar but without pjax tags

kwazaro commented 5 years ago

If I simply remove Pjax "open" and "end" widget calls in comment custom view, than submit button works strange, it becomes blured and page won't refresh. It looks like removing Pjax broke the comment widget itself,

mtangoo commented 5 years ago

Pjax does things AJAX-ically mean does not need reload. If you disable PJax then you have to write Ajax stuffs yourself

kwazaro commented 5 years ago

I discovered the problem. Some requests were blocked by ModSecurity. I hope this info will help someone in future:

ModSecurity: Access denied with code 424 (phase 2). Found 3 byte(s) in REQUEST_URI outside range: 1-255. [file "/usr/local/apache2/conf/modsecurity/asl/asl.conf"] [line "32"] [id "390613"] [rev "10"] [msg "RS-2: Invalid character in request or headers"] [severity "CRITICAL"] [hostname "my.domain.com"] [uri "/comment/default/create"] [unique_id "XExy2mp6Hy@T4dhsorbhXQAAAFM"]