Disallow VersionType.FORCE for GetRequest (#21079)

This doesn't make much sense to have at all, since a user can do a `GET`
request without a version of they want to get it unconditionally.

Relates to #20995
This commit is contained in:
Lee Hinman 2016-11-01 12:15:56 -06:00 committed by GitHub
parent 7751049c14
commit eb4b6cd816
1 changed files with 3 additions and 0 deletions

View File

@ -101,6 +101,9 @@ public class GetRequest extends SingleShardRequest<GetRequest> implements Realti
validationException = ValidateActions.addValidationError("illegal version value [" + version + "] for version type [" + versionType.name() + "]", validationException = ValidateActions.addValidationError("illegal version value [" + version + "] for version type [" + versionType.name() + "]",
validationException); validationException);
} }
if (versionType == VersionType.FORCE) {
validationException = ValidateActions.addValidationError("version type [force] may no longer be used", validationException);
}
return validationException; return validationException;
} }