homebysix / recipe-robot

A kick ass tool for creating AutoPkg recipes.
Apache License 2.0
300 stars 28 forks source link

Add support for setting a user-agent in preferences for discovery #148

Open n8felton opened 5 years ago

n8felton commented 5 years ago

Is your feature request related to a problem? Please describe. While attempting to connect to a vendor URL, I get 403 Forbidden when I do not provide a user-agent with the request headers.

Describe the solution you'd like Possible suggestions:

  1. Use the current system's Safari user-agent. I'm not sure if this can be queried from the system anywhere, or if it would need to be generated
  2. The ability to set a specific user-agent in the preferences.
  3. The ability to set a specific user-agent with a command-line argument.

Describe alternatives you've considered Manually creating the recipe by hand.

Additional context To see what I mean:

curl -LI http://upgrade01.sky.shoretel.com/ClientInstall

vs

curl -LI -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36' http://upgrade01.sky.shoretel.com/ClientInstall