Proxy Issue (wyUpdate user-agent spoofing)

Hi,

I'm evaluating wyBuild to update our desktop applications. As part of our testing we had issues running wyUpdate behind our company proxy. Based on the documentation I was surprised the auto proxy feature did not work so I traced the wyUpdate request via Fiddler to find our proxy server was blocking the request because it was using an IE V9 user agent.

Looking at the source I found wyUpdate -> FileDownloader.cs -> WebRequest was hard coding the user agent:((HttpWebRequest)request).UserAgent = "Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 6.1; en-US; wyUpdate)";

Removing this line of code worked for our proxy. I see this line of code as meeting a specific requirement which as used in our environment causes issues with the assumption that this user agent setting is OK for all.

I would see value if you could remove this line of code and provide a command line user agent configuration option. This would provide added flexibility and compatibility for more environments not compatible with this hard coded user agent. Otherwise, I could customise the code myself and remove the hard coded user agent setting.

Can you let me know is this is a reasonable change or if there were other options to bypass the user agent setting I was not aware of.

Note: I have used the proxy configuration option to set a specific proxy server which has worked. As our desktop applications are installed on client sites this creates a lot of work if this was required for each site. The auto proxy feature is prefered.

Regards,Alain

Hey Alain,

The reason we added that user agent in the first place was to work around proxies that use the user-agent to "filter" requests. The user-agent is user-supplied and thus can be user-altered. It shouldn't be used for filtering requests in proxies (because it can never be trusted to be accurate).

That being said, in the next version of wyUpdate we'll update the fake-user-agent to the latest version of Edge.

In the meantime the solution is to alter the source code to use a user-agent that works in your specific proxy configuration.

Hi,

I'm a bit confused. How is the user agent user supplied and how do you alter the user agent without altering the source code? Is there a command line switch for this?

Alain

What I was saying is that user-agents shouldn't be used to filter requests at all through your proxies because by there very nature they are spoof-able (which is what wyUpdate does to get past proxies.

So if you have any control over proxies in your organization you should change them to not care about user-agents at all.

If you don't have control over the proxies in your organization, then you can alter the wyUpdate source code and change the spoofed user-0agent to one that will trick your proxies.