1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-09 02:59:19 +00:00

Change RequestHandler signature

This commit is contained in:
Darren Shepherd
2018-01-30 16:49:37 -07:00
parent fe053853bb
commit 87d5ab06b9
8 changed files with 22 additions and 10 deletions

View File

@@ -16,7 +16,12 @@ func addSchemasHeader(apiContext *types.APIContext) error {
return nil
}
apiContext.Response.Header().Set("X-Api-Schemas", apiContext.URLBuilder.Collection(schema, apiContext.Version))
version := apiContext.SchemasVersion
if version == nil {
version = apiContext.Version
}
apiContext.Response.Header().Set("X-Api-Schemas", apiContext.URLBuilder.Collection(schema, version))
return nil
}