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