Browse Source

fix reading post bodies (#686)

Now that https://github.com/golang/go/issues/15527 is supposedly fixed, this condition should be no-longer needed. Further, if php didn't request enough bytes, this condition would be hit. It appears PHP requests chunks ~2mb in size at a time.
Rob Landers 11 months ago
parent
commit
d973206174
1 changed files with 0 additions and 6 deletions
  1. 0 6
      frankenphp.go

+ 0 - 6
frankenphp.go

@@ -746,12 +746,6 @@ func go_read_post(rh C.uintptr_t, cBuf *C.char, countBytes C.size_t) (readBytes
 		readBytes += C.size_t(n)
 	}
 
-	if err != nil && err != io.EOF {
-		// invalid Read on closed Body may happen because of https://github.com/golang/go/issues/15527
-		fc, _ := FromContext(r.Context())
-		fc.logger.Error("error while reading the request body", zap.Error(err))
-	}
-
 	return
 }