From cefe8db20587f9f5ae2abfb8824a48fb8981c302 Mon Sep 17 00:00:00 2001 From: Elia Cereda Date: Sun, 10 Nov 2024 12:55:03 +0100 Subject: [PATCH] Update cURL command for easier copy-pasting Print a backslash at the end of each line in the cURL command printed by URLSession requests, so that the command can be directly copy-pasted in the Terminal --- RxCocoa/Foundation/URLSession+Rx.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RxCocoa/Foundation/URLSession+Rx.swift b/RxCocoa/Foundation/URLSession+Rx.swift index 93e65ccf82..e7ed4c4ba5 100644 --- a/RxCocoa/Foundation/URLSession+Rx.swift +++ b/RxCocoa/Foundation/URLSession+Rx.swift @@ -61,12 +61,12 @@ private func convertURLRequestToCurlCommand(_ request: URLRequest) -> String { for (key, value) in request.allHTTPHeaderFields ?? [:] { let escapedKey = escapeTerminalString(key as String) let escapedValue = escapeTerminalString(value as String) - returnValue += "\n -H \"\(escapedKey): \(escapedValue)\" " + returnValue += "\\\n -H \"\(escapedKey): \(escapedValue)\" " } let URLString = request.url?.absoluteString ?? "" - returnValue += "\n\"\(escapeTerminalString(URLString))\"" + returnValue += "\\\n\"\(escapeTerminalString(URLString))\"" returnValue += " -i -v"