title: How to return a relative URI Location header with Flask?
body: <p>Flask replaces the content of my Location header when building my HTTP response.
  It change my actual relative URI Location header with an absolute one.</p>
  <pre><code>@app.route('/votes', methods=['POST'])
  def votes():
      return jsonify(), 201, {'location': '/votes/1'}
  </code></pre>
  <p>my test :</p>
  <pre><code>def test_vote_creation(self):
      response = self.app.post('/votes',
                               data=json.dumps({
                                   'name': 'Test vote'
                               }), content_type='application/json')
      print(response.headers['location'])
  </code></pre>
  <p>return <code>http://localhost/votes/1</code> instead of <code>/votes/1</code></p>
  <p><strong>How to return a relative URI Location header with Flask jsonify ?</strong></p>
  <p>Edit: According to the current version of the HTTP/1.1 standard, RFC 2616, the value of the Location header must be <a href="https://www.rfc-editor.org/rfc/rfc2616#section-14.30" rel="nofollow noreferrer">an absolute URI</a>.
  But the RCF is going to change to allow relative URIs as well. So I want to change the default behaviour of my API to answer with a relative URI in my location header.</p>
  <p>more detail on <a href="https://webmasters.stackexchange.com/questions/31274/what-are-the-consequences-for-using-relative-location-headers#31337">this post</a></p>