@@ -95,7 +95,7 @@ pub mod header_parsing {
9595 pub enum ParseHeaderError {
9696 #[ error( "Too many headers received. Limit is of 5 headers" ) ]
9797 MaxHeadersLimitExceeded ,
98- #[ error( "A value passed in header is not formattable to plain visible ASCII" ) ]
98+ #[ error( "A value passed in header can't be formatted to plain visible ASCII" ) ]
9999 InvalidValue ,
100100 #[ error( "Invalid Key was passed which terminated just after the end of prefix" ) ]
101101 Emptykey ,
@@ -154,13 +154,14 @@ pub mod update {
154154 "Native" . to_string ( )
155155 }
156156
157- // User Agent for Github API call
158- // Format: Parseable/<version> (OS; Platform)
157+ // User Agent for Download API call
158+ // Format: Parseable/<version>/<commit_hash> (OS; Platform)
159159 fn user_agent ( ) -> String {
160160 let info = os_info:: get ( ) ;
161161 format ! (
162- "Parseable/{} ({}; {})" ,
163- current( ) ,
162+ "Parseable/{}/{} ({}; {})" ,
163+ current( ) . 0 ,
164+ current( ) . 1 ,
164165 info. os_type( ) ,
165166 is_docker( )
166167 )
@@ -170,19 +171,19 @@ pub mod update {
170171 let agent = ureq:: builder ( ) . user_agent ( user_agent ( ) . as_str ( ) ) . build ( ) ;
171172
172173 let json: serde_json:: Value = agent
173- . get ( "https://api.github.com/repos/parseablehq/parseable/releases/ latest" )
174+ . get ( "https://download.parseable.io/ latest-version " )
174175 . call ( ) ?
175176 . into_json ( ) ?;
176177
177178 let version = json[ "tag_name" ]
178179 . as_str ( )
179180 . and_then ( |ver| ver. strip_prefix ( 'v' ) )
180181 . and_then ( |ver| semver:: Version :: parse ( ver) . ok ( ) )
181- . ok_or_else ( || anyhow ! ( "Bad parse when parsing verison " ) ) ?;
182+ . ok_or_else ( || anyhow ! ( "Failed parsing version " ) ) ?;
182183
183184 let date = json[ "published_at" ]
184185 . as_str ( )
185- . ok_or_else ( || anyhow ! ( "Bad parse when parsing published date" ) ) ?;
186+ . ok_or_else ( || anyhow ! ( "Failed parsing published date" ) ) ?;
186187
187188 let date = chrono:: DateTime :: parse_from_rfc3339 ( date)
188189 . expect ( "date-time from github is in rfc3339 format" )
0 commit comments