titaniumnetwork-dev / Ultraviolet

A highly sophisticated proxy used for evading internet censorship or accessing websites in a controlled sandbox using the power of service-workers. Works by intercepting HTTP requests with a service worker script that follows the TompHTTP specifications.
https://docs.titaniumnetwork.org/proxies/ultraviolet
GNU Affero General Public License v3.0
565 stars 4.13k forks source link

Remove duplicate check for request prefix #132

Closed itschasa closed 7 months ago

itschasa commented 7 months ago

As mentioned in this comment on the commit: https://github.com/titaniumnetwork-dev/Ultraviolet/commit/6ddb73ecd4f2dfb3158771c57ff38d8927dcaf08#r140981857

This check is already performed in the fetch method: https://github.com/titaniumnetwork-dev/Ultraviolet/blob/c34745ffd0c97cd2e190300e57ce9e784474e638/src/uv.sw.js#L50-L58

IncognitoTGT commented 7 months ago

This is actually necessary. It's weird

itschasa commented 7 months ago

Does someone mind explaining?

proudparrot2 commented 7 months ago

In case someone who id using their own service worker or and didn’t include this check inside of it

itschasa commented 7 months ago

In case someone who id using their own service worker or and didn’t include this check inside of it

Hasn't the check for it always been inside the service worker fetch function? I don't get how doing the check again before it enters the function's scope helps?

Percslol commented 7 months ago

In case someone who id using their own service worker or and didn’t include this check inside of it

Hasn't the check for it always been inside the service worker fetch function? I don't get how doing the check again before it enters the function's scope helps?

no it was added recently because of some weird race conditions, its also good idiot proofing since anyone can modify the service worker and easily mess up this check somehow

IncognitoTGT commented 7 months ago

race conditions my beloved

itschasa commented 7 months ago

In case someone who id using their own service worker or and didn’t include this check inside of it

Hasn't the check for it always been inside the service worker fetch function? I don't get how doing the check again before it enters the function's scope helps?

no it was added recently because of some weird race conditions, its also good idiot proofing since anyone can modify the service worker and easily mess up this check somehow

Understood, I'll close the PR.