OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Swarming Authors. All rights reserved. | 2 # Copyright 2014 The Swarming Authors. All rights reserved. |
3 # Use of this source code is governed by the Apache v2.0 license that can be | 3 # Use of this source code is governed by the Apache v2.0 license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Tools to control application running via dev_appserver.py. | 6 """Tools to control application running via dev_appserver.py. |
7 | 7 |
8 Useful for smoke and integration tests. | 8 Useful for smoke and integration tests. |
9 """ | 9 """ |
10 | 10 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 266 |
267 It only works with apps that use 'auth' component. | 267 It only works with apps that use 'auth' component. |
268 """ | 268 """ |
269 if self._xsrf_token is None: | 269 if self._xsrf_token is None: |
270 resp = self.json_request( | 270 resp = self.json_request( |
271 '/auth/api/v1/accounts/self/xsrf_token', | 271 '/auth/api/v1/accounts/self/xsrf_token', |
272 body={}, | 272 body={}, |
273 headers={'X-XSRF-Token-Request': '1'}) | 273 headers={'X-XSRF-Token-Request': '1'}) |
274 self._xsrf_token = resp.body['xsrf_token'].encode('ascii') | 274 self._xsrf_token = resp.body['xsrf_token'].encode('ascii') |
275 return self._xsrf_token | 275 return self._xsrf_token |
OLD | NEW |