avitorio / outstatic

Outstatic - A static CMS for Next.js
https://Outstatic.com
MIT License
2.67k stars 157 forks source link

OST_REPO_OWNER is not used for /api/image #85

Closed vildzi closed 1 year ago

vildzi commented 1 year ago

Provide environment information

ENV Flags Set:

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

When a user who is not the owner of the repo (and OST_REPO_OWNER is set) is adding or viewing images in a post, a "Couldn't load image." error occurs.

Screenshot 2023-02-15 at 11 25 00 AM

Expected Behavior

OST_REPO_OWNER should be used when getting images from raw.githubusercontent.com if set rather than always using the current users username.

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

N/A - any deployment with OST_REPO_OWNER set will work to reproduce the issue

To Reproduce

avitorio commented 1 year ago

@vildzi Thank you for this! I just merged your PR!