Change error for missing cap

This commit is contained in:
Christoph Hagen 2023-02-17 12:27:08 +01:00
parent fe0fdec03d
commit 464f87fdb5
3 changed files with 4 additions and 11 deletions

View File

@ -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 {

View File

@ -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

View File

@ -1,10 +1,3 @@
//
// Router+Extensions.swift
// App
//
// Created by Christoph on 05.05.20.
//
import Vapor import Vapor
extension Application { extension Application {