@@ -17,7 +17,7 @@ use std::ffi::OsStr;
1717
1818use base64:: Engine ;
1919use futures_util:: StreamExt ;
20- use http:: HeaderName ;
20+ use http:: { header :: ACCEPT , HeaderName } ;
2121use minisign_verify:: { PublicKey , Signature } ;
2222use percent_encoding:: { AsciiSet , CONTROLS } ;
2323use reqwest:: {
@@ -345,7 +345,9 @@ impl Updater {
345345 pub async fn check ( & self ) -> Result < Option < Update > > {
346346 // we want JSON only
347347 let mut headers = self . headers . clone ( ) ;
348- headers. insert ( "Accept" , HeaderValue :: from_str ( "application/json" ) . unwrap ( ) ) ;
348+ if !headers. contains_key ( ACCEPT ) {
349+ headers. insert ( ACCEPT , HeaderValue :: from_static ( "application/json" ) ) ;
350+ }
349351
350352 // Set SSL certs for linux if they aren't available.
351353 #[ cfg( target_os = "linux" ) ]
@@ -549,10 +551,9 @@ impl Update {
549551 ) -> Result < Vec < u8 > > {
550552 // set our headers
551553 let mut headers = self . headers . clone ( ) ;
552- headers. insert (
553- "Accept" ,
554- HeaderValue :: from_str ( "application/octet-stream" ) . unwrap ( ) ,
555- ) ;
554+ if !headers. contains_key ( ACCEPT ) {
555+ headers. insert ( ACCEPT , HeaderValue :: from_static ( "application/octet-stream" ) ) ;
556+ }
556557
557558 let mut request = ClientBuilder :: new ( ) . user_agent ( UPDATER_USER_AGENT ) ;
558559 if let Some ( timeout) = self . timeout {
0 commit comments