diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..99c02d0 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,13 @@ +HttpBin is written and maintained by Kenneth Reitz and +various contributors: + +Development Lead +```````````````` + +- Kenneth Reitz <_@kennethreitz.com> + + +Patches and Suggestions +``````````````````````` + +- Zbigniew Siciarz \ No newline at end of file diff --git a/README.md b/README.md index c7df1b5..04688db 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ httpbin(1): HTTP Client Testing Service `/status/:code` Returns given HTTP Status code. `/redirect/:n` 302 Redirects *n* times. `/cookies` Returns cookie data. -`/set-cookie/:name/:value` Sets a simple cookie. +`/cookies/set/:name/:value` Sets a simple cookie. ## DESCRIPTION Testing an HTTP Library can become difficult sometimes. PostBin.org is fantastic -for testing POST requests, but not much else. This exists to cover all kinds of HTTP +for testing POST requests, but not much else. This exists to cover all kinds of HTTP scenarios. Additional endpoints are being considered: `/basic-auth`, `/deflate`, *&c*. All endpoint responses are JSON-encoded. diff --git a/httpbin/core.py b/httpbin/core.py index d57756e..bcbd71a 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -183,17 +183,17 @@ def view_status_code(code): def view_cookies(): """Returns cookie data.""" - return request.cookies + return dict(cookies=request.cookies) -@app.route('/set-cookie//') +@app.route('/cookies/set//') def set_cookie(name, value): """Sets a cookie and redirects to cookie list.""" - response = app.make_response(redirect('/cookies')) - response.set_cookie(key=name, value=value) + r = app.make_response(redirect('/cookies')) + r.set_cookie(key=name, value=value) - return response + return r @app.route('/basic-auth')