JSON API: Only do the work on GET requests.

This commit is contained in:
tastytea 2021-01-09 14:53:40 +01:00
parent e7acf29df9
commit 63355e98e7
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 6 additions and 0 deletions

View File

@ -72,6 +72,12 @@ int main(int /*argc*/, char * /*argv*/[])
cout << "Content-Type: application/json\r\n\r\n";
char *env{getenv("REQUEST_METHOD")};
if (env != nullptr && string(env) != "GET")
{
return 0;
}
git::init(true);
bool remove_lockfile{false};