We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Following https://fabianfett.de/swift-on-aws-lambda-creating-your-first-http-endpoint, there is the section about curl + 404:
curl -i http://localhost:7000/invoke
gives
HTTP/1.1 404 Not Found
Which seems to be triggered by the default branch in processRequest(context:request:):
processRequest(context:request:)
// unknown call default: self.writeResponse(context: context, status: .notFound)
I think this should be:
I'd suggest to switch on the url at the top level, and then within do the necessary guard for a resource, like:
case url.hasSuffix(Consts.postResponseURLSuffix): guard method == .POST else { return self.writeResponse(context: context, status: .methodNotAllowed) }
The text was updated successfully, but these errors were encountered:
thanks for reporting @helje5, imo your proposal makes sense. @fabianfett wdyt?
Sorry, something went wrong.
@tomerd I think this should be solved with the better testing facilities (two port solution).
Successfully merging a pull request may close this issue.
Following https://fabianfett.de/swift-on-aws-lambda-creating-your-first-http-endpoint, there is the section about curl + 404:
gives
Which seems to be triggered by the default branch in
processRequest(context:request:)
:I think this should be:
Essentially a path which exists for a POST should not throw a 404 for a GET.
I'd suggest to switch on the url at the top level, and then within do the necessary guard for a resource, like:
The text was updated successfully, but these errors were encountered: