basti1302 / elm-lang-de

Website elm-lang.de
http://elm-lang.de
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

www-prefix in URL field causes 400 when trying to save profile changes #20

Closed RobertWalter83 closed 7 years ago

RobertWalter83 commented 7 years ago

I typed "www.digital-ember.com" into the URL field on the "edit profile" page, which let to a 400 bad request trying to save my changes: image

basti1302 commented 7 years ago

Thanks a lot for the report! I actually think that it is the missing http:///https:// prefix which causes the problem. I have not investigated it yet, though.

Maybe related: if you somehow manage to put a URL without a protocol like http into the database, the link on the profile page is wrong. You can see this at https://elm-lang.de/#developers/klaftertief. @klaftertief's profile has such a URL and the link on his profile page goes to https://elm-lang.de/klaftertief.de. (I guess the URL was automatically imported from his public GitHub profile data when creating the account).

basti1302 commented 7 years ago

The app now prepends "http://" automatically before validating the URL, if necessary.

Also, responses with HTTP 400 bad request actually trigger a notification so the user knows the profile has not been saved.

RobertWalter83 commented 7 years ago

Sweet.