mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	Fix CefURLRequest crash with failing HEAD requests (fixes issue #3226)
This commit is contained in:
		
				
					committed by
					
						 Marshall Greenblatt
						Marshall Greenblatt
					
				
			
			
				
	
			
			
			
						parent
						
							099901c122
						
					
				
				
					commit
					89c902b54d
				
			| @@ -406,19 +406,24 @@ class CefBrowserURLRequest::Context | |||||||
|     DCHECK(CalledOnValidThread()); |     DCHECK(CalledOnValidThread()); | ||||||
|     DCHECK_EQ(status_, UR_IO_PENDING); |     DCHECK_EQ(status_, UR_IO_PENDING); | ||||||
|  |  | ||||||
|     response_->SetReadOnly(false); |  | ||||||
|     response_->SetResponseHeaders(*headers); |  | ||||||
|     response_->SetReadOnly(true); |  | ||||||
|  |  | ||||||
|     // Match the previous behavior of sending download progress notifications |  | ||||||
|     // for UR_FLAG_NO_DOWNLOAD_DATA requests but not HEAD requests. |  | ||||||
|     if (request_->GetMethod().ToString() != "HEAD") { |  | ||||||
|       download_data_size_ = headers->GetContentLength(); |  | ||||||
|       OnDownloadProgress(0); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     cleanup_immediately_ = true; |     cleanup_immediately_ = true; | ||||||
|     OnComplete(true); |  | ||||||
|  |     if (headers) { | ||||||
|  |       response_->SetReadOnly(false); | ||||||
|  |       response_->SetResponseHeaders(*headers); | ||||||
|  |       response_->SetReadOnly(true); | ||||||
|  |  | ||||||
|  |       // Match the previous behavior of sending download progress notifications | ||||||
|  |       // for UR_FLAG_NO_DOWNLOAD_DATA requests but not HEAD requests. | ||||||
|  |       if (request_->GetMethod().ToString() != "HEAD") { | ||||||
|  |         download_data_size_ = headers->GetContentLength(); | ||||||
|  |         OnDownloadProgress(0); | ||||||
|  |       } | ||||||
|  |  | ||||||
|  |       OnComplete(true); | ||||||
|  |     } else { | ||||||
|  |       OnComplete(false); | ||||||
|  |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   void OnRedirect(const net::RedirectInfo& redirect_info, |   void OnRedirect(const net::RedirectInfo& redirect_info, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user