File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -276,13 +276,28 @@ where
276276 let ( name_len, version_len) =
277277 context. full_name_lengths . get ( full_name) . map_or_else (
278278 || {
279- Err ( Error :: new (
280- ErrorKind :: InvalidData ,
281- format ! ( "unknown full name: {full_name:?} in {:?}" , clickhouse) ,
282- ) )
279+ if clickhouse. response_status . not_modified ( ) {
280+ Ok ( & ( 0 , 0 ) )
281+ } else {
282+ Err ( Error :: new (
283+ ErrorKind :: InvalidData ,
284+ format ! (
285+ "unknown full name: {full_name:?} in {:?}" ,
286+ clickhouse
287+ ) ,
288+ ) )
289+ }
283290 } ,
284291 Ok ,
285292 ) ?;
293+
294+ // 304s can be missing the headers for gem, version, platform
295+ // Don't error if that's the case, just continue, since it is such
296+ // a small percentage of the requests.
297+ if * name_len == 0 && * version_len == 0 {
298+ continue ;
299+ }
300+
286301 let name_end = * name_len as usize ;
287302 let version_end = name_end + 1 + * version_len as usize ;
288303 clickhouse. gem = Some ( Cow :: Borrowed ( & full_name[ ..name_end] ) ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ impl ResponseStatus {
1515 pub fn is_success ( & self ) -> bool {
1616 self . 0 == 200 || self . 0 == 304
1717 }
18+
19+ pub fn not_modified ( & self ) -> bool {
20+ self . 0 == 304
21+ }
1822}
1923
2024impl < ' de > Deserialize < ' de > for ResponseStatus {
You can’t perform that action at this time.
0 commit comments