unjs / giget

✨ Download templates and git repositories with pleasure!
MIT License
463 stars 38 forks source link

fix(gitlab): workaround hotlinking protection (406 Not Acceptable) #123

Closed andreymart-test closed 9 months ago

andreymart-test commented 10 months ago

problem: https://github.com/unjs/giget/issues/97

reason: This returns an Error 406, Im guessing due to the hotlinking rules https://gitlab.com/gitlab-org/gitlab/-/commit/50c11f278d18fe1f3fb12eb595067216bb58ade2

solved: need to add a mode mode: 'same-origin' in fetch that solves the problem.

codecov[bot] commented 9 months ago

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (1945818) 55.07% compared to head (81e327f) 54.93%.

Files Patch % Lines
src/_utils.ts 60.00% 2 Missing :warning:
src/providers.ts 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #123 +/- ## ========================================== - Coverage 55.07% 54.93% -0.15% ========================================== Files 7 7 Lines 601 608 +7 Branches 46 47 +1 ========================================== + Hits 331 334 +3 - Misses 269 273 +4 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

pi0 commented 9 months ago

Thanks for working on this dear @andreymart-test ❤️

I have made slight changes to only set mode and header for gitlab provider as it seems adding mode breaks other providers like github.