rclement / business-card-generator

Generate digital QR-code business cards
https://business-card-generator.vercel.app
GNU Affero General Public License v3.0
37 stars 10 forks source link

http(s) prefix requirement in site field #178

Open aspeer06 opened 1 year ago

aspeer06 commented 1 year ago

A tilda in a vcard website URL causes an exception http://site.com/~user

rclement commented 1 year ago

Thanks for your feedback @aspeer06!

However I cannot reproduce this issue: https://business-card-generator.vercel.app/card?card_type=vcard&firstname=John&lastname=Doe&nickname=&picture=&birthday=&company=&job=&email=&phone=&website=http%3A%2F%2Fsite.com%2F%7Euser&street=&city=&zipcode=&state=&country=

Could you share a link with the issue happening please?

aspeer06 commented 1 year ago

Actually I believe the error is anything in the site field that doesn't start with http(s). https://business-card-generator.vercel.app/card?card_type=vcard&firstname=John&lastname=Doe&nickname=&picture=&birthday=&company=&job=&email=&phone=&website=site.com&street=&city=&zipcode=&state=&country=

Sorry for delay in response

rclement commented 1 year ago

@aspeer06 What are you expecting here? Do you want to be able to display only mywebsite.com without a prefix?

A compliant website URL begins with either http:// or https:// prefix. In HTML if you only specify a link to mywebsite.com, the browser will interpret it as a relative link to the app: business-card-generator.vercel.app/mywebsite.com, so it does not work natively without prefixes.

Potential solutions here:

For now, I would rather stick with stricter validation and hiding the prefix only for display.

aspeer06 commented 1 year ago

Stricter validation makes sense to me as well in the submission form.