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

malformed image URL in module 2 #1

Open
stanchiang opened this issue Apr 29, 2024 · 0 comments
Open

malformed image URL in module 2 #1

stanchiang opened this issue Apr 29, 2024 · 0 comments

Comments

@stanchiang
Copy link

hi I was just going through this tutorial on YouTube and noticed the image for the bob's burgers characters return a malformed image URL.

at https://svelte.fun/api/bobs-burgers/characters/1
I get
{"id":1,"name":""Dottie Minerva"","image":"//svelte.fun/bobs-burgers/images/1.jpg","gender":"Female","hairColor":"Blonde","occupation":"Student at Wagstaff School","firstEpisode":""The Kids Run the Restaurant"","voicedBy":"Wendy Molyneux","url":"https://bobsburgers-api.herokuapp.com/characters/1","wikiUrl":"https://bobs-burgers.fandom.com/wiki/%22Dottie_Minerva%22","relatives":[]}

and was expecting the image url to be https://svelte.fun/bobs-burgers/images/1.jpg

I did a fix on my side

characters = characters.map(character => ({
    ...character,
    image: character.image.startsWith('//') ? 'https:' + character.image : character.image
}));

but would be great to not need that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant