Change error for missing cap
This commit is contained in:
parent
fe0fdec03d
commit
464f87fdb5
@ -35,7 +35,7 @@ extension CapServer {
|
||||
}
|
||||
|
||||
// Upload an image
|
||||
app.postCatching("images", .parameter("cap")) { request in
|
||||
app.postCatching("image", .parameter("cap")) { request in
|
||||
try self.ensureOperability()
|
||||
try authenticator.authorize(request)
|
||||
guard let cap = request.parameters.get("cap", as: Int.self) else {
|
||||
|
@ -12,7 +12,7 @@ enum CapError: Error {
|
||||
|
||||
/**
|
||||
|
||||
HTTP Code: 404
|
||||
HTTP Code: 410
|
||||
*/
|
||||
case unknownId
|
||||
|
||||
@ -55,8 +55,8 @@ enum CapError: Error {
|
||||
|
||||
var response: HTTPResponseStatus {
|
||||
switch self {
|
||||
/// 404
|
||||
case .unknownId: return .notFound
|
||||
/// 410
|
||||
case .unknownId: return .gone
|
||||
/// 400
|
||||
case .invalidBody: return .badRequest
|
||||
/// 406
|
||||
|
@ -1,10 +1,3 @@
|
||||
//
|
||||
// Router+Extensions.swift
|
||||
// App
|
||||
//
|
||||
// Created by Christoph on 05.05.20.
|
||||
//
|
||||
|
||||
import Vapor
|
||||
|
||||
extension Application {
|
||||
|
Loading…
Reference in New Issue
Block a user