Jump to content

How to block special URL request methods?


Recommended Posts

LCF-AT

Hi guys,

new day new question. :) So this time I would like to know how I can block request methods for URLs. There many methods and most used of them are HEAD, GET, POST etc. I wanna block some POST methods on websites who using it and was trying to check out uBlock Origin manual to find anything about that and found "no-fetch-if.js" and "no-xhr-if.js" and was trying to use it with a website but they didn't work and the POST request is still working without to block it...example...

web1.com,web2.com##+js(no-xhr-if, method:POST)
web1.com,web2.com##+js(no-fetch-if, method:POST)

https://github.com/gorhill/uBlock/wiki/Resources-Library

...now I would like to know whether I can block any webpage anyhow else to disable POST requests for all or just special URLs etc maybe with Tampermonkey or so? Has anyone an idea?

greetz

Link to comment
  • 1 month later...

Hi guys,

just have another question how to change request & response headers. I found another AddOn / Extension called ModHeader...

https://github.com/modheader/modheader

...and its telling me to change both (request / response) and I tried it out. Its works to change request headers but in case of response I don't see any changes in browser network tab. My question is why its not working or whether its anyhow working to change the responses? Maybe anyone could check this AddOn to test it. In my case I tried to change the entry "server: nginx" to "Server 123" entering this in response + adding URL pattern for the site. Similar I did with request header just to see whether it works anyhow. As I said, in case of request header change it works but not in response header and just wanna know why or whether its just fake or limited etc.

Otherwise I found a command in uBO called "responseheader"..

https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#response-header-filtering

...which is limited with 4 static commands.

Also found another command which is experimental...

https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#header

....but this is not working also if I set the filterOnHeaders to true in advanced settings. In my filter list its showing this command as invalid...

*$script,header=via:1.1 google

...when using header=xy. Anyway, just would like to know whether its possible to modify resonses at all or not? Maybe you can tell me something about it. Thanks.

greetz

Link to comment

Hi,

I'am using Fiddler to check the traffic but also with this tool I don't see any changes on the response header when using this AddOn. Look at this image...

Resp1_2022-08-27_221258.png.685aa360a55b278b721232b5f34e3fe3.png

...so here you can see my test creating one request rule and two Response rules for YT and duck webpage just for testings only to see whether it works etc. Now I'am calling YT webpage and in the request header I can see the changes of Referer which holds my Close name inside = success but in case of Response header nothing was changed. Just have a look on my response in Firefox (same in fiddler too)...

Resp2_2022-08-27_221258.png.55d9fb37d6e8e1f51a2c490f33529985.png

....you see no changes in my response header. No change on Report-to & Server entrys. Just makes me wonder why its not working or whether it works at all. Also have test a extension in Chrome / Brave browser called....

https://github.com/gera2ld/request-x

....and there you could also modify request & response in headers but for me its just working with request header only. :( Just wanna know is it a fake or what is it? How to modify the response headers?

155350420-37db70c6-94d0-4d78-a48d-1e78f7

....so maybe anyone could tell me or test any of those AddOns / Extension trying to modify the Response Header (any value xy) successfully.

greetz

Link to comment

Changing requests is easy but modifying a response on https is harder and not sure if any extensions are capable of it

Fiddler can easily modify request or responses

It's a while since I used fiddler but used to use it a lot to modify requests or change responses based on request and should do exactly what you need although probably not as user friendly as an extension

 

  • Like 1
Link to comment

So thats the point I'am asking about. Why the heck telling the extensions / AddOns I mention above (2 I found) they can DO that if they can NOT do it?! Just fake or what?

I'am still looking for any working AddOn / Extension what can do modify responses. If you see any of them etc then please tell me to check them out. Otherwise I don't wanna use use extern tools like fiddler to manage that and would like to prefer inside browser tools (extension / AddOn) to handle it.

greetz

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...