Sometimes people will stumble on scripts that connect to taskcluster APIs. They might not know about taskcluster, and may instinctively visit the top level domain. Currently, if they visit one of them, they will get a HTTP 404 with a payload "Cannot GET /". Since we have docs for each service, it would make sense, at least from the top level path, to redirect to those docs. Explicitly, let's set up the following HTTP 302 redirects: http(s)://auth.taskcluster.net/ -> http://docs.taskcluster.net/auth/api-docs http(s)://aws-provisioner.taskcluster.net/ -> http://docs.taskcluster.net/aws-provisioner/api-docs http(s)://hooks.taskcluster.net/ -> http://docs.taskcluster.net/services/hooks http(s)://index.taskcluster.net/ -> http://docs.taskcluster.net/services/index http(s)://purge-cache.taskcluster.net/ -> http://docs.taskcluster.net/services/purge-cache http(s)://queue.taskcluster.net/ -> http://docs.taskcluster.net/queue/api-docs http(s)://scheduler.taskcluster.net/ -> http://docs.taskcluster.net/scheduler/api-docs http(s)://secrets.taskcluster.net/ -> http://docs.taskcluster.net/services/secrets http(s)://taskcluster-github.herokuapp.com/ -> http://docs.taskcluster.net/services/taskcluster-github We could also consider redirecting from /v1 to the same docs location on all of the above domains. This brings us a lot closer to the concept of "self describing apis", although of course not all the way. Originally proposed here: * https://github.com/taskcluster/taskcluster-secrets/pull/6/files#r48695860
N.B. I've raised bug 1237585 to rename `taskcluster-github.herokuapp.com` to `github.taskcluster.net`.
I like this, but I'd like to rename the docs first (bug 1056282) which would change the redirect locations, so if you don't mind holding off that'd be great.
This should not be a 302 redirect! It should be a 404, with HTML body that shows a link to the docs site. If you want redirection from browser perspective use a meta-tag. I want an API call that misses it's target to get a 404, that's a lot better than a redirect.
While we're at it, the error pages should include Access-Control-Allow-Origin headers. Right now if you get the API endpoints wrong in a browser, you just get a slew of same-origin failures, rather than a 404.
Updated title to be more accurate: Display link to docs in default 404 handler.
Could we implement this now that bug 1056282 is closed?