@@ -112,10 +112,10 @@ export default class httpClient {
112112
113113 async request ( config : AxiosRequestConfig , log : Logger ) : Promise < Record < string , any > > {
114114 log . debug ( `http request: ${ config . method } ${ config . url } ` ) ;
115- if ( config && config . data && ! config . data . skipLogging && ! config . data . name && ! config . data . snapshot ) {
115+ if ( config && config . data && ! config . data . skipLogging && ! config . data . name && ! config . data . snapshot && config . method !== 'PUT' ) {
116116 log . debug ( config . data ) ;
117117 }
118- if ( config && config . data && ! config . data . skipLogging && config . data . snapshotUuid ) {
118+ if ( config && config . data && ! config . data . skipLogging && config . data . snapshotUuid && config . method !== 'PUT' ) {
119119 log . debug ( config . data ) ;
120120 }
121121 return this . axiosInstance . request ( config )
@@ -307,7 +307,8 @@ export default class httpClient {
307307 git,
308308 config,
309309 isStartExec,
310- baselineBuild
310+ baselineBuild,
311+ packageVersion : pkgJSON . version ,
311312 } ,
312313 headers : {
313314 projectToken : '' ,
@@ -614,7 +615,24 @@ export default class httpClient {
614615 }
615616
616617 uploadLogs ( ctx : Context , uploadURL : string ) {
617- const logContent = fs . readFileSync ( constants . LOG_FILE_PATH ) ;
618+ const fileStream = fs . createReadStream ( constants . LOG_FILE_PATH ) ;
619+ const { size } = fs . statSync ( constants . LOG_FILE_PATH ) ;
620+
621+ return this . request ( {
622+ url : uploadURL ,
623+ method : 'PUT' ,
624+ headers : {
625+ 'Content-Type' : 'text/plain' ,
626+ 'Content-Length' : size ,
627+ } ,
628+ data : fileStream ,
629+ maxBodyLength : Infinity , // prevent axios from limiting the body size
630+ maxContentLength : Infinity , // prevent axios from limiting the content size
631+ } , ctx . log )
632+ }
633+
634+ uploadLogsForCaps ( ctx : Context , uploadURL : string ) {
635+ const logContent = fs . readFileSync ( constants . LOG_FILE_PATH )
618636 const { size } = fs . statSync ( constants . LOG_FILE_PATH ) ;
619637
620638 return this . request ( {
0 commit comments