Skip to content

Commit

Permalink
Disallow .reload() on POST requests
Browse files Browse the repository at this point in the history
Fixes #74.
  • Loading branch information
mgedmin committed Jun 27, 2019
1 parent 98aef32 commit 190eb6d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/zope/testbrowser/browser.py
Expand Up @@ -193,6 +193,12 @@ def reload(self):
raise BrowserStateError("no URL has yet been .open()ed")

req = self._response.request
if req.method != 'GET':
raise BrowserStateError(
".reload() of a %s request is not supported."
" Consider browser.open(browser.url) instead."
% req.method
)
with self._preparedRequest(self.url):
resp = self.testapp.request(req)
self._setResponse(resp)
Expand Down

0 comments on commit 190eb6d

Please sign in to comment.