Change User-Agent on HTTP Get/Post actions

851 views
Skip to first unread message

zztzed

unread,
Apr 27, 2012, 2:38:53 PM4/27/12
to Tasker
I know this isn't the "feature requests" group, but I've seen a few
other feature requests here, so here goes.

It would be nice if Tasker had the ability to change the User-Agent
header it uses on HTTP Get/Post actions, OR if it included some
keyword(s) in the User-Agent header to indicate that it's running on
an Android device.

My university's wireless network uses an obnoxious network access
control system that blocks all traffic and forcibly redirects HTTP
requests to its captive portal until it sees that either:
(a) you're using a mobile device (based on your user-agent when you
make an HTTP request); or
(b) you've authenticated and installed their "policy key".
I'd like to be able to set up a task to *invisibly* load a page for me
when I connect to my university's wireless so that the NAC will
already have authorized my device. However, when using an HTTP Get
action from within Tasker, the NAC instead returns a page saying it
doesn't recognize my browser, since the User-Agent header is just
"Tasker/versionnumber".

Since my device is rooted and I have stericson's BusyBox build
installed, I've worked around it by using the wget built into that
version of BusyBox and having *that* attempt to fetch a file from my
webserver with a spoofed User-Agent (even just the word "iPhone"
worked), *then* having Tasker make an HTTP GET request for that same
file to make sure the contents are correct and retrying the entire
task until it is (when the NAC recognizes that you are using a mobile
device, it redirects you to the university's homepage). However, I
feel this is somewhat inelegant and the dependency on root and an
external utility is undesirable in any case. (I suppose I could use
the "Browse URL" action instead of calling BusyBox via "Run Shell",
thereby eliminating the dependency on root and an external utility,
but that fails the "invisible" criterion since Browse URL opens the
default browser.)

I understand that User-Agent spoofing could potentially be used for
nefarious purposes (or at least, that that's likely to be an
objection), but even if the User-Agent Tasker uses were simply changed
to something like "Tasker/12.34u5 (Android 4.5.6)" rather than having
the ability to change it entirely, that would make it immensely more
useful for me.

Pent

unread,
Apr 28, 2012, 3:12:49 AM4/28/12
to Tasker

> objection), but even if the User-Agent Tasker uses were simply changed
> to something like "Tasker/12.34u5 (Android 4.5.6)" rather than having
> the ability to change it entirely, that would make it immensely more
> useful for me

Sure, can put the OS version in for next time.

Pent

Pent

unread,
Apr 28, 2012, 4:27:36 AM4/28/12
to Tasker
> Sure, can put the OS version in for next time.

It's Tasker/x.y.z (Android/x.y.z) next version.

Pent

Sancho Virág Attila

unread,
Apr 18, 2014, 6:55:46 PM4/18/14
to tas...@googlegroups.com
Hi Pent!

When will you add the User Agent feature to the HTTP Get?

Thank you!

Pent

unread,
Apr 19, 2014, 11:08:38 AM4/19/14
to tas...@googlegroups.com

When will you add the User Agent feature to the HTTP Get?


It's more likely to be added as a global preference, no ETA available.

Pent
Reply all
Reply to author
Forward
0 new messages