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

Use url::Url or allow passing strings to Redirect #176

Closed
JadedBlueEyes opened this issue Jan 22, 2022 · 3 comments
Closed

Use url::Url or allow passing strings to Redirect #176

JadedBlueEyes opened this issue Jan 22, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@JadedBlueEyes
Copy link
Contributor

JadedBlueEyes commented Jan 22, 2022

Description of the feature

It would be ideal if Poem did not use its own Uri and insead used the url crate for type-interoperability with other crates, like reqwest, etc.

Code example (if possible)

At the moment I have to do this:

    // Takes `poem::Uri`, results in URL being validated needlessly
    Ok(Redirect::temporary(poem::http::Uri::from_str(redirect.as_str())?))

I would prefer:

    // Takes `Url` type  
    Ok(Redirect::temporary(redirect))

    // Takes `String` type  
    Ok(Redirect::temporary(redirect.to_string()))
@JadedBlueEyes JadedBlueEyes added the enhancement New feature or request label Jan 22, 2022
@sunli829
Copy link
Collaborator

You are right, so now the type is changed from Uri to impl Display.

@sunli829
Copy link
Collaborator

Released in v1.2.44

@JadedBlueEyes
Copy link
Contributor Author

Thank you!

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

No branches or pull requests

2 participants