Merge ~roadmr/canonical-identity-provider:rename-vcs-header into canonical-identity-provider:master

Proposed by Daniel Manrique
Status: Merged
Approved by: Daniel Manrique
Approved revision: 052df6af058bcc918d294bc4a9cbf2918cf321a6
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~roadmr/canonical-identity-provider:rename-vcs-header
Merge into: canonical-identity-provider:master
Diff against target: 13 lines (+1/-1)
1 file modified
src/identityprovider/wsgi.py (+1/-1)
Reviewer Review Type Date Requested Status
Maximiliano Bertacchini Approve
Daniel Manrique (community) Approve
Guillermo Gonzalez Approve
Review via email: mp+382684@code.launchpad.net

Commit message

Rename the revision header to x-vcs-header to make it vcs-agnostic (no more bzr assumption)

Description of the change

QA:

curl --head https://login.staging.ubuntu.com | grep X-Vcs-Revision || echo "it didn't work"

The header name will now match what other services (dashboard, api.snapcraft.io) use.

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

+1

review: Approve
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

Good idea. Do note SCA returns "X-VCS-Revision", with upper "VCS".

review: Approve
Revision history for this message
Daniel Manrique (roadmr) wrote :

Interesting - so does api.snapcraft.io, so I'll adjust.

In practice though header names are mostly treated case-insensitively (the code that eats this in the spec looks at x-vcs-revision).

Thanks!

review: Approve
052df6a... by Daniel Manrique

fixed header name

Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

+1

review: Approve
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

right, headers are case-insensitive: https://tools.ietf.org/html/rfc7230#section-3.2

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/identityprovider/wsgi.py b/src/identityprovider/wsgi.py
2index 88828bb..48d99b1 100644
3--- a/src/identityprovider/wsgi.py
4+++ b/src/identityprovider/wsgi.py
5@@ -41,7 +41,7 @@ class OOPSWSGIHandler(oops_wsgi_django.OOPSWSGIHandler):
6
7
8 class BzrRevnoMiddleware(object):
9- REVNO_HEADER = ('X-Bzr-Revision-Number', version_info['revno'])
10+ REVNO_HEADER = ('X-VCS-Revision', version_info['revno'])
11
12 def __init__(self, app):
13 self.app = app

Subscribers

People subscribed via source and target branches