Jump to content
Ketarin forum

No user-agent on variable requests

Recommended Posts

I'm seeing strange UA behavior in Ketarin 1.8.7. I haven't tested this thoroughly, but in my experiments I'm seeing a couple bugs.


First, I'd love for the global default user-agent to be alterable. Not just the UA for specific apps, but for the entire installation all at once.


Now for the bugs:


I assume that the user-agent will be included with all requests, but that's not actually the case. At least during development in the Variables editor, URL requests are sent with an empty UA. Since this is a sure-fire sign of unwelcome traffic, some servers (including my own) block the request with a 403 forbidden. Including the UA with these requests is important.


Now, the default UA is *not* included in those instances. But if you set a custom UA in the Advanced settings tab that UA will be used immediately on Variables URL requests.


The workaround is to manually assign a custom UA for each app that has problems due to UA filtering.


Expected behavior is to use the global UA for all requests, especially those from the Variables feature, except where it's superseded by the app-specific "User agent" option.

Share this post

Link to post
Share on other sites

Mileage may vary, but here's a "workaround" for you.  I say "workaround" because, while the method I'm sharing successfully sets an application profile's user agent on update, finding one of the few applicable ones in my list to test is like finding a needle in a haystack.


Making the details verbose for anyone who hasn't worked with these settings.


Create a Global Variable:

File -> Settings -> Global variables


Name = user_agent

Value = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3007.0 Safari/537.36


Create a Global Command:

File -> Settings -> Commands

Edit command for event = Before updating an application

Command = PowerShell script

$app."UserAgent" = $globalvars."user_agent".CachedContent

Share this post

Link to post
Share on other sites

Thank you. Warning to anyone reading this and trying the above code: if you're relying upon specific UA's for different apps, this will cause problems for them.


A safer workaround is to select all items in the list, copy, paste into notepad, find/replace "<UserAgent />" with "<UserAgent>{user_agent}</UserAgent>", select all, copy & paste it back into Ketarin. This method will only replace the UA if a custom one is not set...but...


Workarounds are easy (at least for creating a new general UA), but it really needs to be fixed in the release. The no-UA behavior for new apps is a serious defect as far as I'm concerned. It could very likely get you banned from a server when you are creating a new app profile because you're not aware that it's sending a null header.

Share this post

Link to post
Share on other sites

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