Skip to content
New issue

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

Add "302 Found" HTTP response #507

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from

Conversation

DominikPalo
Copy link

@DominikPalo DominikPalo commented Oct 12, 2021

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)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant