Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 753243b

Browse files
committed
Use UUID to name temp XMLRPC files
[The current way of naming temp files using PID][Link] can be problematic if there are concurrent uploads. [Link]: https://github.com/wordpress-mobile/WordPressKit-iOS/blob/e7d2c04c1be6c602c2f285643f6e1e19f935a8d7/WordPressKit/WordPressOrgXMLRPCApi.swift#L257-L261
1 parent d9c7980 commit 753243b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

WordPressKit/HTTPRequestBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ final class HTTPRequestBuilder {
215215
request.setValue("text/xml", forHTTPHeaderField: "Content-Type")
216216
let encoder = WPXMLRPCEncoder(method: xmlrpcRequest.method, andParameters: xmlrpcRequest.parameters)
217217
if forceWriteToFile {
218-
let fileName = "\(ProcessInfo.processInfo.globallyUniqueString)_file.xmlrpc"
218+
let fileName = "\(UUID().uuidString).xmlrpc"
219219
let fileURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(fileName)
220220
try encoder.encode(toFile: fileURL.path)
221221

0 commit comments

Comments
 (0)