Skip to content

Commit

Permalink
Update PapyrusCore/Sources/Request.swift
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Wright <[email protected]>
  • Loading branch information
NoahKamara and joshuawright11 authored Mar 19, 2024
1 parent 68f5550 commit af51f59
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions PapyrusCore/Sources/Request.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,8 @@ public extension Request {
components.append("-X \(method)")

// Add headers
if sortedHeaders {
for (key, value) in headers.sorted(by: { $0.key < $1.key }) {
components.append("-H '\(key): \(value)'")
}
} else {
for (key, value) in headers {
components.append("-H '\(key): \(value)'")
}
}
let headerOptions = headers.map { "-H '\($0): \($1)'" }
components += sortedHeaders ? headerOptions.sorted() : headerOptions

// Add body
if let bodyData = body {
Expand Down

0 comments on commit af51f59

Please sign in to comment.