lingthio / Flask-User

Customizable User Authorization & User Management: Register, Confirm, Login, Change username/password, Forgot password and more.
http://flask-user.readthedocs.io/
MIT License
1.06k stars 292 forks source link

Patch make safe url #194

Closed pbugni closed 6 years ago

pbugni commented 7 years ago

Current version of UserManager__Utils.make_safe_url is dysfunctional when including a query string, namely, it removes the '?' delimiter.

This PR includes a working version and the tests to demonstrate the problem (and the working solution).

codecov-io commented 7 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@765be07). Click here to learn what that means. The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #194   +/-   ##
=========================================
  Coverage          ?   93.85%           
=========================================
  Files             ?       24           
  Lines             ?     1368           
  Branches          ?        0           
=========================================
  Hits              ?     1284           
  Misses            ?       84           
  Partials          ?        0
Impacted Files Coverage Δ
flask_user/user_manager__utils.py 92.59% <66.66%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 765be07...81b11cb. Read the comment docs.

matt-leolabs commented 6 years ago

Just wanted to chime in and say I just came across this in my own code and would love to see it merged soon!

matt-leolabs commented 6 years ago

This should also fix the version of make_safe_url here: https://github.com/lingthio/Flask-User/blob/v0.6/flask_user/views.py#L739

lingthio commented 6 years ago

Thank you for your suggestion. I incorporated the make_safe_url fixes into the v0.6.20 build.