# How to alter the behaviour/ response to unauthorised access of private repo?

**URL:** <https://forum.gitea.com/t/how-to-alter-the-behaviour-response-to-unauthorised-access-of-private-repo/6816>\
**Category:** Install/Maintain/Configure\
**Created:** [March 2, 2023, 3:02pm UTC](https://forum.gitea.com/t/how-to-alter-the-behaviour-response-to-unauthorised-access-of-private-repo/6816 "2023-03-02T15:02:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimmymcheung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jimmymcheung/32/3496_2.png) [@jimmymcheung](https://forum.gitea.com/u/jimmymcheung)\
**Post date:** [March 2, 2023, 3:02pm UTC](https://forum.gitea.com/t/how-to-alter-the-behaviour-response-to-unauthorised-access-of-private-repo/6816/1 "2023-03-02T15:02:24Z")

</div>

Currently (as of version 1.18.3) if one tries to view a private repo without proper access (eg. not logged in), Gitea will response with `404` code, which semantically should be `401` or `403`. I understand this might due to security reasons, but it is possible to change Gitea’s behaviour to response `401` if the origin is `trusted` (like the request is from a trusted IP range), while remain the `404` response to the general internet?
