Make --require-auth only apply to push
This enables anonymous read access if even if the flag is
present.
@@ -490,7 +490,11 @@ async fn call_service(
headref = "HEAD".to_string();
}
- if !josh_proxy::auth::check_auth(&remote_url, &auth, ARGS.is_present("require-auth"))
+ if !josh_proxy::auth::check_auth(
+ &remote_url,
+ &auth,
+ ARGS.is_present("require-auth") && parsed_url.pathinfo == "/git-receive-pack",
+ )
.in_current_span()
.await?
{
