Elasticsearch version (bin/elasticsearch --version): 6.0.0
Description of the problem including expected versus actual behavior:
When the cat API is used on APIs that support URL parameters like index names, then calling those endpoints with &h to get help results in an error
Steps to reproduce:
# works
GET _cat/shards?help
GET _cat/shards/test
# returns an exception
GET _cat/shards/test?help