Skip to content
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

Image source URL properties containing localhost do not work #3496

Closed
adamterlson opened this issue Oct 18, 2015 · 8 comments
Closed

Image source URL properties containing localhost do not work #3496

adamterlson opened this issue Oct 18, 2015 · 8 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@adamterlson
Copy link
Contributor

Experienced behavior on iOS.

I'm serving an image locally from a web server, bound identically under two hostnames: http://localhost:3000/myImage.png and http://foobar:3000/myImage.png

Works as expected:
<Image source={{uri: 'http://foobar:3000/myImage.png'}} />

However, the following does not work, and no request hits the server hosted server at all, so may not be making the request at all or it may be mangled/routed somewhere unexpected.
<Image source={{uri: 'http://localhost:3000/myImage.png'}} />

@nautical
Copy link
Contributor

@adamterlson , Can you once try opening the same image in the simulators safari .

@adamterlson
Copy link
Contributor Author

The image loads in Safari.

@nautical
Copy link
Contributor

Also please make sure to allow http services in simulator (settings>developer) . I tried and its working perfectly , can you specify your version of react ntive and please assign width and height also to the image .

screen shot 2015-10-19 at 4 07 58 am

@adamterlson
Copy link
Contributor Author

Sorry, I didn't specify the width and height in my example to just focus on the bit that changed.

That Allow HTTP Services did it! Why is that setting required to access an image hosted at http://localhost but not http://foobar, do you know?

@nautical
Copy link
Contributor

Please refer to this https://forums.developer.apple.com/thread/6205 .

@adamterlson
Copy link
Contributor Author

Sorry, can you link to the specific post that's relevant or summarize? It's a bit dense for me to be honest and reading through it didn't find any explanation for this behavior.

Otherwise, no problem, thanks for the help!

@browniefed
Copy link
Contributor

@facebook-github-bot answered

@facebook-github-bot
Copy link
Contributor

Closing this issue as @browniefed says the question asked has been answered. Please help us by asking questions on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.

@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Mar 20, 2016
@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants