Set HTTP user agent to git/GIT_VERSION
PATCH 1/1 Set HTTP user agent to git/GIT_VERSION
Useful for diagnostics/troubleshooting to know which client versions are hitting your server.
Signed-off-by Nick Hengeveld <[email protected]>
---
Makefile | 3 +++ http.c | 2 ++ 2 files changed, 5 insertions(+), 0 deletions(-)
468d4d4ac3cbdb0757a7cc1c207ca379ce3a5d56
Makefile +3 -0
@@ -510,6 +510,9 @@ git$X git.spec \ exec_cmd.o: exec_cmd.c $(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' $< +http.o: http.c + $(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $< + ifdef NO_EXPAT http-fetch.o: http-fetch.c $(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $<
http.c +2 -0
@@ -195,6 +195,8 @@ #endifif (getenv ("GIT_CURL_VERBOSE" ))curl_easy_setopt (result,CURLOPT_VERBOSE ,1 ); +curl_easy_setopt (result,CURLOPT_USERAGENT ,GIT_USER_AGENT ); +return result; }
Signature · 1 line
1.3.0.rc1.g9aef-dirty