diff options
author | A. Jesse Jiryu Davis <jesse@mongodb.com> | 2020-08-10 11:01:48 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-11 14:26:02 +0000 |
commit | cf8949deb58129f7d01084ef6f01c495a70da94c (patch) | |
tree | 0f2004714a53195022ba7a4501675dc7b89cc1df /src/mongo/db/initialize_api_parameters.cpp | |
parent | d3a19d99832e817a7f241cf1a295f53d2065af25 (diff) | |
download | mongo-cf8949deb58129f7d01084ef6f01c495a70da94c.tar.gz |
SERVER-49887 Add requireApiVersion server parameter
Diffstat (limited to 'src/mongo/db/initialize_api_parameters.cpp')
-rw-r--r-- | src/mongo/db/initialize_api_parameters.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/initialize_api_parameters.cpp b/src/mongo/db/initialize_api_parameters.cpp index ed7245d7d41..dec5e477fa1 100644 --- a/src/mongo/db/initialize_api_parameters.cpp +++ b/src/mongo/db/initialize_api_parameters.cpp @@ -37,6 +37,10 @@ const APIParametersFromClient initializeAPIParameters(const BSONObj& requestBody auto apiParamsFromClient = APIParametersFromClient::parse("APIParametersFromClient"_sd, requestBody); + if (gRequireApiVersion.load()) { + uassert(498870, "Missing apiVersion parameter", apiParamsFromClient.getApiVersion()); + } + if (apiParamsFromClient.getApiDeprecationErrors() || apiParamsFromClient.getApiStrict()) { uassert(4886600, "Provided apiStrict and/or apiDeprecationErrors without passing apiVersion", |