GoogleCloudPlatform / cloudbowl-microservice-game

Apache License 2.0
46 stars 100 forks source link

Can't join the arena with a username containing non US-ASCII charackter #24

Open tarczynskitomek opened 2 years ago

tarczynskitomek commented 2 years ago

Tried joining with a user name "Tomek Tarczyński" - note the ń char, and the validation didn't allow me.

Steps to reproduce:

  1. Try joining the arena
  2. Use username with with ń or ł char
  3. Get a validation error
  4. Change ń to n
  5. Validation passes
jamesward commented 2 years ago

Yeah, that is just my terrible mistake. The code is here: https://github.com/GoogleCloudPlatform/cloudbowl-microservice-game/blob/master/app/models/Data.scala#L470

I'm not quite sure why I restricted that field. But this is definitely a bug I'll fix. Thanks for reporting.

tarczynskitomek commented 2 years ago

Hi @jamesward, thanks for looking into this! I think the check is a reasonable thing it's just too restrictive. What I'd suggest is e.g. [^\p{L}0-9\s] regex - it'll match any characters other that space, numbers and any kind of letter from any language. I can create a PR if you think it's fine ;-)

jamesward commented 2 years ago

I think that sounds great and would love a PR :)

tarczynskitomek commented 2 years ago

Done, also signed the CLA thingy :-)