Skip to content

Commit 13532ff

Browse files
committed
[cHttpRequest] Always send Content-Length header on non-GET methods
1 parent 4b093b6 commit 13532ff

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

contrib/cHttpRequest.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ Public Sub Open_(ByVal Method As String, ByVal Url As String, Optional ByVal Asy
429429
m_oSocket.Close_
430430
Set m_oSocket = pvCreateNewSocket
431431
End If
432-
.Method = Method
432+
.Method = UCase$(Method)
433433
.Remote = uParsed
434434
.Async = IIf(Not IsMissing(Async), Async, False)
435435
.NumOfRedirects = 0
@@ -495,7 +495,7 @@ Public Sub Send(Optional ByVal Body As Variant)
495495
GoTo QH
496496
End If
497497
'--- prepare headers
498-
If Not .Stream Is Nothing Then
498+
If Not .Stream Is Nothing Or .Method <> "GET" Then
499499
SetRequestHeader HDR_CONTENT_LENGTH, IStream_GetSize(.Stream)
500500
End If
501501
If LenB(.Remote.User) <> 0 Or LenB(.Remote.Pass) <> 0 Then

0 commit comments

Comments
 (0)