<script>document.cookie = “humans_21909=1”; document.location.reload(true)</script>

不羁岁月 提交于 2020-01-02 01:24:08

问题


web API build with wordpress is showing error of

<script>document.cookie = "humans_21909=1"; document.location.reload(true)</script>

it works sometime on some network and sometime not working


回答1:


First of all, clone the website using the All In One WP Migration to your local development machine. Then, check the REST API, if the same error persists. It means you have some error in your code. In my case, the REST API works perfectly fine in my local machine but shows the same HTTP 409 conflict. I contacted with the Bluehost support. They told me they have some mod_security issues. After 2 3 days, they fixed it. It worked fine after that.




回答2:


I ran into the same Problem and below are the two json api have issues which are using Json API User Plugin.

http://example.com/api/get_nonce/?json=get_nonce&controller=user&method=register

http://example.com/api/user/register/?username=eww_test&email=john@domain.com&display_name=John&notify=both&seconds=100&insecure=cool

Then i move whole site to localhost and check APIs and they were working fine so i contacted host in my case hostgator.

They suggested to disable mod_security for that domain which was subdomain in my case.

And The issue has been resolved.

Tested and worked well




回答3:


I got same response for an API ending with api/register , then i change the name /register to /new_registerthen issue solved,

I think register in url is the reason for this error



来源:https://stackoverflow.com/questions/55915264/scriptdocument-cookie-humans-21909-1-document-location-reloadtrue-scri

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!