@@ -15,12 +15,12 @@ use std::borrow::Cow;
15
15
use std:: cell:: RefCell ;
16
16
use std:: collections:: { HashMap , HashSet } ;
17
17
use std:: ffi:: OsStr ;
18
- use std:: fs:: { create_dir_all, File } ;
18
+ use std:: fmt;
19
+ use std:: fs:: File ;
19
20
use std:: io:: { self , Read , Write } ;
20
21
use std:: path:: Path ;
21
22
use std:: rc:: Rc ;
22
23
use std:: sync:: Arc ;
23
- use std:: { env, fmt} ;
24
24
25
25
use anyhow:: { Context , Result } ;
26
26
use backoff:: backoff:: Backoff ;
@@ -42,7 +42,6 @@ use serde::{Deserialize, Serialize};
42
42
use sha1_smol:: Digest ;
43
43
use symbolic:: common:: DebugId ;
44
44
use symbolic:: debuginfo:: ObjectKind ;
45
- use url:: Url ;
46
45
use uuid:: Uuid ;
47
46
48
47
use crate :: api:: errors:: ProjectRenamedError ;
@@ -1841,15 +1840,6 @@ impl ApiResponse {
1841
1840
if let Some ( ref body) = self . body {
1842
1841
let body = String :: from_utf8_lossy ( body) ;
1843
1842
debug ! ( "body: {}" , body) ;
1844
-
1845
- // Internal helper for making it easier to write integration tests.
1846
- // Should not be used publicly, as it may be removed without prior warning.
1847
- // Accepts a relative or absolute path to the directory where responses should be stored.
1848
- if let Ok ( dir) = env:: var ( "SENTRY_DUMP_RESPONSES" ) {
1849
- if let Err ( err) = dump_response ( dir, & self . url , body. into_owned ( ) ) {
1850
- debug ! ( "Could not dump a response: {}" , err) ;
1851
- } ;
1852
- }
1853
1843
}
1854
1844
if self . ok ( ) {
1855
1845
return Ok ( self ) ;
@@ -1991,23 +1981,6 @@ fn log_headers(is_response: bool, data: &[u8]) {
1991
1981
}
1992
1982
}
1993
1983
1994
- fn dump_response ( mut dir : String , url : & str , body : String ) -> Result < ( ) > {
1995
- if dir. starts_with ( '~' ) {
1996
- dir = format ! (
1997
- "{}{}" ,
1998
- dirs:: home_dir( ) . unwrap_or_default( ) . display( ) ,
1999
- dir. trim_start_matches( '~' )
2000
- ) ;
2001
- }
2002
- let filename = Url :: parse ( url) ?. path ( ) . trim_matches ( '/' ) . replace ( '/' , "__" ) ;
2003
- create_dir_all ( & dir) ?;
2004
- let filepath = format ! ( "{}/{}.json" , & dir, filename) ;
2005
- let mut file = File :: create ( & filepath) ?;
2006
- file. write_all ( & body. into_bytes ( ) ) ?;
2007
- debug ! ( "Response dumped to: {}" , & filepath) ;
2008
- Ok ( ( ) )
2009
- }
2010
-
2011
1984
#[ derive( Debug , Deserialize ) ]
2012
1985
#[ serde( rename_all = "lowercase" ) ]
2013
1986
enum ErrorInfo {
0 commit comments