Endpoint working on preview but not via browser?

Hi there! I'm having some problems with my worker instance, the endpoint seems to be working on the quick edit preview but not on the browser...
Yes, I did deploy and I have no idea why this isn't working
Doesn't seem to be a cache problem either

here's the code I'm using:
    // other endpoints that do work

    if (pathname.startsWith('/propic')) {
      const id = pathname.split("/")[2];
      if (!id) {
        return jsonResponse({ status: 'error', message: 'No user ID provided' }, 400, headers);
      }
      
      const userData = await fetchDiscordAPI(`users/${id}`);
      if (userData && userData.avatar) {
        const avatarURL = `https://cdn.discordapp.com/avatars/${id}/${userData.avatar}.png`;
        return fetchAndRespond(avatarURL, 'image/png', headers);
      } else {
        return jsonResponse({ status: 'error', message: 'User has no avatar' }, 404, headers);
      }
    }

    return jsonResponse({ status: 'error', message: 'Endpoint not found!' }, 404, headers);
  } catch (error) {
    return jsonResponse({ status: 'error', message: 'An error occurred' }, 500, headers);
  }
}


I have deployed and updated everything, it seems to be completely missing the propic endpoint, it does work on the preview though..?
image.png
image.png
Was this page helpful?