build: do not pass undefined to Auth header in CI scripts
This commit is contained in:
		
					parent
					
						
							
								d313ddbd3d
							
						
					
				
			
			
				commit
				
					
						a48968c1ce
					
				
			
		
					 1 changed files with 7 additions and 4 deletions
				
			
		|  | @ -36,11 +36,14 @@ const vstsArmJobs = [ | |||
| let jobRequestedCount = 0; | ||||
| 
 | ||||
| async function makeRequest ({ auth, url, headers, body, method }) { | ||||
|   const clonedHeaders = { | ||||
|     ...(headers || {}) | ||||
|   }; | ||||
|   if (auth && auth.bearer) { | ||||
|     clonedHeaders.Authorization = `Bearer ${auth.bearer}`; | ||||
|   } | ||||
|   const response = await got(url, { | ||||
|     headers: { | ||||
|       Authorization: auth && auth.bearer ? `Bearer ${auth.bearer}` : undefined, | ||||
|       ...(headers || {}) | ||||
|     }, | ||||
|     headers: clonedHeaders, | ||||
|     body, | ||||
|     method, | ||||
|     auth: auth && auth.password ? `${auth.username}:${auth.password}` : undefined | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Samuel Attard
				Samuel Attard