mirror of
https://github.com/appy-one/acebase-server.git
synced 2026-06-30 06:02:05 -06:00
Merge branch 'master' of https://github.com/appy-one/acebase-server
This commit is contained in:
commit
0f25a54b58
1 changed files with 6 additions and 5 deletions
|
|
@ -58,12 +58,13 @@ export const addRoute = (env: RouteInitEnvironment) => {
|
|||
if (contentType === 'image/png') { //state.provider === 'google' &&
|
||||
// Don't accept image/png, because it's probably a placeholder image. Google does this by creating a png with people's initials
|
||||
user_details.picture = [];
|
||||
return;
|
||||
}
|
||||
const image = await response.arrayBuffer();
|
||||
let buff = Buffer.from(image);
|
||||
best.url = `data:${contentType};base64,${buff.toString('base64')}`;
|
||||
user_details.picture = [best]; // Only keep the best one
|
||||
else {
|
||||
const image = await response.arrayBuffer();
|
||||
let buff = Buffer.from(image);
|
||||
best.url = `data:${contentType};base64,${buff.toString('base64')}`;
|
||||
user_details.picture = [best]; // Only keep the best one
|
||||
}
|
||||
}
|
||||
catch(err) {
|
||||
env.debug.warn(`Could not fetch profile picture from "${best.url}": `, err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue