swifter
swifter copied to clipboard
Add "302 Found" HTTP response
The "302 Found HTTP" response is a common way of performing URL redirection. We use the swifter framework in our projects for creating a local webserver handling OAuth2 flow and the 302 Found HTTP response is a recommended way for redirecting to the OAuth2 success pages.
I created this PR to make things easier, so instead of writing
server[self.callbackPath] = { _ in
return .raw(302, "Found", ["Location": authSuccessUri], nil)
}
we could just write
server[self.callbackPath] = { _ in
return .found(authSuccessUri)
}