-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from corydolphin/multidict-headers
Adds support for multiple headers of the same name. Fixes #122
- Loading branch information
Showing
4 changed files
with
44 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '2.0.0' | ||
__version__ = '2.0.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
test | ||
~~~~ | ||
Flask-Cors tests module | ||
""" | ||
|
||
from ..base_test import FlaskCorsTestCase | ||
from flask import Flask, Response | ||
|
||
from flask_cors import * | ||
from flask_cors.core import * | ||
|
||
|
||
class AllowsMultipleHeaderEntries(FlaskCorsTestCase): | ||
def setUp(self): | ||
self.app = Flask(__name__) | ||
|
||
@self.app.route('/test_multiple_set_cookie_headers') | ||
@cross_origin() | ||
def test_multiple_set_cookie_headers(): | ||
resp = Response("Foo bar baz") | ||
resp.headers.add('set-cookie', 'foo') | ||
resp.headers.add('set-cookie', 'bar') | ||
return resp | ||
|
||
def test_multiple_set_cookie_headers(self): | ||
resp = self.get('/test_multiple_set_cookie_headers') | ||
self.assertEqual(len(resp.headers.getlist('set-cookie')), 2) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters