Skip to content

malformed image URL in module 2 #1

@stanchiang

Description

@stanchiang

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions