Author

Topic: Blocked while pasting some code in a post (Read 128 times)

legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
May 07, 2021, 04:25:19 AM
#4
See:
Fixed, thanks. Whenever this happens, please email or obfuscate-then-PM me what you posted. Cloudflare has a ton of rules, some of which seem useful (like detecting fake robots), but others do stupid stuff like that.
legendary
Activity: 2338
Merit: 10802
There are lies, damned lies and statistics. MTwain
<…>
I’ve had that happen a couple of times whislt writting a small sql query. If it’s small, and you really want to publish it as a post here, you can go by trial and error to see if you can detect the keyword/s or line/s that are making it display the Blocked message, and alter them slightly, adding a comment to what needs to be changed to make it work.

For example, in the code that you showed in the image file, the keyword to change was onreadystatechange, which I’ve change to onreadyYstatechange here (extra Y included):

Code:
Var sochain = new XMLHttpRequest();
Var url2= "https://chain.so/api/v2/get_info/BTC";
Sochain.open("GET",url2);
Sochain.responsetype('json');

Sochain.onreadyYstatechange= function() {
If (this.readyState ==4 && this.status ==200) {
Alert(sochain.response.data.network)}
}, sochain.send();
legendary
Activity: 3654
Merit: 8909
https://bpip.org
Yeah cloudflare apparently thinks you're trying to inject malicious JavaScript. Happens sometimes.

Use pastebin instead of image - easier for the recipient to copy it.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
I was helping a user to make an API request using javascript, and after clicking Post button i received the following error message:



This is the blocked piece of code and the post. I was able to post it as an image, but if I use that as text inside
Code:
tag I got blocked again:

[quote author=bitmover link=topic=5335574.msg56953946#msg56953946 date=1620347975]
I like sochain API. It is simple and easy to use. And free. https://www.sochain.com/api/

To make a simple API request to a block explorer, using only javascript an no jquery, you can simple use this:

(my code was blocked for security reasons, i will post it as an image:
[img width=300]https://i.imgur.com/GFV4XBJ.png[/img]
[/quote]

I was blocked by cloudfare... Not a big deal, but it never happened to me in this forum before. I can image some people might be able to attack the forum using some pieces of that code. But I was quite surprised.
Jump to: