Skip to content

Add an option to enable Default UA in HTTP Request if the rule not specified#76

Open
AlanCui4080 wants to merge 6 commits intolz233:masterfrom
AlanCui4080:master
Open

Add an option to enable Default UA in HTTP Request if the rule not specified#76
AlanCui4080 wants to merge 6 commits intolz233:masterfrom
AlanCui4080:master

Conversation

@AlanCui4080
Copy link
Copy Markdown

Hi,

When the UA is not specified in the rule, the HTTP(S) request will be send with no UA/ default UA, that will cause the server of the short links refuse to redirecting due to risk management and WAF, resulting cause a HTTP 404 or HTTP 412.

This PR adds an option to enable Default UA in HTTP Request if the rule not specified, and a textbox to edit the Default UA ( "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Mobile Safari/537.36" by default).

image image

Alan.

@lz233
Copy link
Copy Markdown
Owner

lz233 commented Feb 11, 2026

I don't want this option since user can override UA per rules. Just fill device default UA when the rule not specify the UA override is a good idea. This can be obtained from Webview or OkHttp.

If you wanna implement it, please let me know, otherwise, I will close this PR.

@AlanCui4080
Copy link
Copy Markdown
Author

Hi,

I refactored the current codebase, so that the slide switch now control if we use default UA from Android WebView when the rule does not set one now.

image

Would you like to review it again
Alan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants