Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] Fix curl error "argument list too long" #397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/WebClient.cls
Original file line number Diff line number Diff line change
Expand Up @@ -659,20 +659,29 @@ Public Function PrepareCurlRequest(Request As WebRequest) As String
If web_CookieString <> "" Then
web_Curl = web_Curl & " --cookie '" & web_CookieString & "'"
End If

' Add method, data, and url
' Add method
web_Curl = web_Curl & " -X " & WebHelpers.MethodToName(Request.Method)
web_Curl = web_Curl & " -d '" & Request.Body & "'"

' Add data
Open "requestbody.txt" For Output As #1
Print #1, Request.Body
Close #1
web_Curl = web_Curl & " -d @requestbody.txt'" & "'"

' Add url
web_Curl = web_Curl & " '" & Me.GetFullUrl(Request) & "'"

' Give authenticator opportunity to update cURL
If Not Me.Authenticator Is Nothing Then
Me.Authenticator.PrepareCurl Me, Request, web_Curl
End If

' Log request and return
' Log request
WebHelpers.LogRequest Me, Request
PrepareCurlRequest = web_Curl

' Remove data file and return
PrepareCurlRequest = web_Curl & "&& rm requestbody.txt"
Exit Function

web_ErrorHandling:
Expand Down