fix: add exception when reading 204's
ci/woodpecker/push/lint Pipeline failed Details

dev
Jef Roosens 2022-11-02 20:41:32 +01:00
parent f881122b48
commit 20874bfb0b
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 5 additions and 0 deletions

View File

@ -115,6 +115,11 @@ fn (mut d DockerConn) read_response_body(length int) !string {
fn (mut d DockerConn) read_response() !(http.Response, string) { fn (mut d DockerConn) read_response() !(http.Response, string) {
head := d.read_response_head()! head := d.read_response_head()!
// 204 means "No Content", so we can assume nothing follows after this
if head.status_code == 204 {
return head, ''
}
if head.header.get(http.CommonHeader.transfer_encoding) or { '' } == 'chunked' { if head.header.get(http.CommonHeader.transfer_encoding) or { '' } == 'chunked' {
mut builder := strings.new_builder(1024) mut builder := strings.new_builder(1024)
mut body := d.get_chunked_response_reader() mut body := d.get_chunked_response_reader()