-
Notifications
You must be signed in to change notification settings - Fork 373
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
RegExp fail for FB profile picture URL in validator.isURL #256
Comments
I tested with 5.12.0 and couldn't replicate this. Please upgrade to the latest version and try again. |
I believe it's the trailing '/' at the end of the path (right before the query string) that is causing problems:
|
I tested both and both work in the latest version. There was some issue with that validation which I fixed before the 5.12.0 release. I think that may be the cause. |
You're indeed right. My working copy was out of sync. It works fine on the latest master (and also 5.12.0):
|
On version 5.12.0 works fine. My bad. I didn't check releases before posting issue. Thanks for help. |
System
Steps to reproduce:
Create new user account with photoURL: 'https://lookaside.facebook.com/platform/profilepic/?asid=1573869239329573&height=100&width=100&ext=1523514938&hash=AeRYcBMjHUJiXvR4'
Code:
Error:
Additional info
I'm working on service with Firebase customToken for multiple Facebook appIds and ids_for_business. One of steps required creating new Firebase account with data from FB Graph API. Issue occurs when im trying create user account with picture url from Facebook API (https://developers.facebook.com/docs/graph-api/reference/user/picture/).
I checked photoURL format when account is created with FacebookProviader for single Facebook appId and url looks the same.
I couldn't find any reason why FB url could be invalid. I started debugging firebase-admin lib code and found issue with RegExp here
https://github.com/firebase/firebase-admin-node/blob/master/src/utils/validator.ts#L207 (debuger view https://ibb.co/eZcZwc).
I didn't found similar test case url at https://github.com/firebase/firebase-admin-node/blob/master/test/unit/utils/validator.spec.ts#L382 .
That’s why i think it's a bug. Could you fix this issue for FB picture url?
The text was updated successfully, but these errors were encountered: