vslavik / winsparkle

App update framework for Windows, inspired by Sparkle for macOS
http://winsparkle.org
Other
1.31k stars 267 forks source link

Add support of custom http headers. #181

Closed ostrobrod closed 5 years ago

ostrobrod commented 6 years ago

Here is implemented setup of custom HTTP headers.

Two functions were added in API: win_sparkle_add_http_header adds new header parameter. win_sparkle_clear_http_headers clear all custom header parameters.

Header storage is implemented as std::wstring.

vslavik commented 6 years ago

Thanks! I have questions, though:

  1. Why?
  2. Does Sparkle (for Mac) has anything similar?

At first glance, this seems extremely specialized to be worth making part of the API and maybe a more generic approach with customizing the HTTP request object would make more sense -- but maybe I'm missing something.

ostrobrod commented 6 years ago

Does Sparkle (for Mac) has anything similar?

Yes, Sparkle for Mac has a property of SUUpdater httpHeaders. Using that property you are allowed to add some additional field to HTTP header. In my case, I need send some additional information about a user to the server (this information is used for licensing).

vslavik commented 6 years ago

In my case, I need send some additional information about a user to the server (this information is used for licensing).

Ah, that makes a lot of sense, thanks for the explanation!

vslavik commented 5 years ago

Thanks, merged in 506c0b21b35b9f524e775344327bbd1e3a484d02 and 0c34819f2770e273acd34b1c6634e4d2bdaf0ca5 after some slight cleanup (and small API change, to use win_sparkle_set_http_header() instead of "add", in another commit).