Skip to content

[Image] Can't display avatar with HTTP 301 #5616

@just4fun

Description

@just4fun

I created an iOS APP for university BBS (built in PHP) with React Native 0.14.

When I send request to fetch user info, I will get a record including filed avatar, which has value like http://bbs.uestc.edu.cn/uc_server/avatar.php?uid=32044&size=middle, and I assigned it to source filed of <Image> like below,

<Image
  style={styles.avatar}
  source={{uri: authrization.avatar}} />

Updated recently:

It seems like a PHP method (I'm not familiar with PHP), since the value of avatar will become http://bbs.uestc.edu.cn/uc_server/data/avatar/000/03/20/44_avatar_middle.jpg if I type the original value in the browser.

I tried to display http://bbs.uestc.edu.cn/uc_server/avatar.php?uid=32044&size=middle in html with <img> tag, it will get 301 code and then get the right picture with extension.

However, the avatar is not displayed sometimes with RN. See the screenshot.

Seems like RN didn't support the redirect well even in latest 0.21.

Does the <Image> component only support static picture file which ends with jpg|png|gif?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.Type: EnhancementA new feature or enhancement of an existing feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions