Skip to content

Commit

Permalink
Merge pull request #1 from surfstudio/add-patch-handling
Browse files Browse the repository at this point in the history
Обработка PATCH запроса
  • Loading branch information
ngagarinov authored May 23, 2024
2 parents 8ee24bb + 5e4329c commit 6e6feee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Peasy/Internal/RequestParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct RequestParser {
let methodRaw = String(statusComponents[0])
let pathWithQuery = String(statusComponents[1])

let method = Request.Method(rawValue: methodRaw)!
let method = Request.Method(rawValue: methodRaw) ?? .unknown
let path = parsePath(pathWithQuery)
let headers = parseHeaders(lines.map { String($0) })
let queryParams = parseQueryParams(pathWithQuery)
Expand Down
2 changes: 2 additions & 0 deletions Sources/Peasy/Request.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public extension Request {
case put = "PUT"
case delete = "DELETE"
case head = "HEAD"
case patch = "PATCH"
case unknown
}

/// Represents a query parameter in the request.
Expand Down

0 comments on commit 6e6feee

Please sign in to comment.