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-12 14:25:51 +0000 |
commit | 07ba51a8b8fd29448e013f59a788503b94ed44e9 (patch) | |
tree | f47fbbe2e24fd41c6a10af8ab5fe0462d8da369c /src/mongo/db/initialize_api_parameters.cpp | |
parent | 6fe4c6e1d8cd38637d6fd40e19dacc587f4d0521 (diff) | |
download | mongo-07ba51a8b8fd29448e013f59a788503b94ed44e9.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", |