mozilla/zamboni — pull request #1484 by chuckharmston (2013-12-03 17:50:46+00:00)
Title: Prevent reverse from returning unversioned API URLs; ensure that API-Status: Deprecated is correctly returned; assume API-Version: 1 in unversioned URLs (bug 944343)

The problem here is that some reverses for API endpoints were not including a specific version in the returned URL, so any requests on those URLs were returning `API-Status: Deprecated`. A few changes were made here:

- Added an `API_CURRENT_VERSION` setting.
- Assume that unprefixed requests to the API (`/api/foo` vs. `/api/v1/foo`) are attempting to access v1 of the API.
- Add a namespace to the unprefixed URL pattern to ensure that nothing gets reversed to it.
- Change `APIVersionMiddleware` to only apply `API-Status: Deprecated` when `request.API_VERSION` is less than `settings.API_CURRENT_VERSION`.
- Add assertion that allows tests against URLs returned by the API to be done in a version-agnostic way.

A bug will be filed to provide a smarter way to reverse against a specific API version (defaulting to `request.API_VERSION`).

r? @diox @ashort @robhudson @cvan @mattbasta

This is a blocker for release today, so haste is appreciated!