Simple custom user filter not woking... :-(

Zack

New Member
Hi,

I'm trying to make a custom filter to redirect url or change part of the response but I can't make it to work!

Source: https://104.131.201.115/services/json/?method=test

I tried replacing the word "fail" with the word "error" in the response using the following filter:
Filter: ||104.131.201.115^$replace=/fail/error/img
But it did'nt work...

So I tried redirecting the url with the filter:
Filter: 104.131.201.115#%#AG_onLoad(function() { setTimeout(function() {window.location = "https://104.131.201.116";}, 300); });

But it did'nt work either... :-(

I red many posts about this but it feels like I don't get how to make filters at all... lol

Can anyone help me?
 

avatar

Administrator
Staff member
Administrator
But why IP address, as I understand this rule belongs to pandora.com, right?
 

avatar

Administrator
Staff member
Administrator
Yes, I red on the internet it could help with the country blocked problem.
The thing is that AG won't filter HTTPS for the request when you use an IP address as it considers certificate invalid (certificate name does not match the domain name).
 

avatar

Administrator
Staff member
Administrator
Would it work if I use pandora.com instead? What would the filter look like?
Redirect won't work as this is not an HTML page and javascript won't help with it. There's not much we can do unless $redirect modifier is implemented.

What for $replace, here it is:
Code:
||pandora.com/services/json?method=test$replace=/fail/error/
 

Blaz

Moderator & Translator
Staff member
Moderator
There is a typo in above rule (missing / before ?):
Code:
||pandora.com/services/json/?method=test$replace=/fail/error/
 

Zack

New Member
Not working either... I did some tests with some URLs and I believe I should be using this filter:

||tuner.pandora.com/services/json/?method=test.checkLicencing$replace=/fail/error/

But sadly it's not working. Maybe I didn't set the application properly...
 

Blaz

Moderator & Translator
Staff member
Moderator
Shows "error" fine for both json files you initially posted. Probably a cache issue.
 

avatar

Administrator
Staff member
Administrator
@Zack do you have HTTPS filtering enabled in AG settings? What browser do you use for testing it?
 

Zack

New Member
Thank you for your patience and quick answers :)

I tried on a different browser (chrome) on my android phone and was still not working... The first browser I tried was the default internet app in Android Nougat.

I did not have the HTTPS filtering enabled; I just turned it on (installing the certificate) then I restarted the phone and guess what... It works! :)

Thank guys! :)
 

avatar

Administrator
Staff member
Administrator
I did not have the HTTPS filtering enabled; I just turned it on (installing the certificate) then I restarted the phone and guess what... It works! :)
Yeah, it's mandatory for applying cosmetic rules on a https website:)
 
Top