Unverified Commit 6aaa2ed2 authored by Isis Lovecruft's avatar Isis Lovecruft
Browse files

Revert "Change "client-transport" moat resource type to "moat-transports"."

This reverts commit 50a9321f.
parent b828d577
......@@ -386,12 +386,12 @@ class CaptchaFetchResource(CaptchaResource):
:param str request: A JSON blob containing the following
fields:
* "version": The moat protocol version.
* "type": "moat-transports".
* "supported": ["TRANSPORT", … ]
* "type": "client-transports".
* "supported": ['TRANSPORT', … ]
where:
* ``TRANSPORT`` is a string identifying a transport, e.g.
"obfs3" or "obfs4". Currently supported transport identifiers
are: "vanilla", "fte", "obfs3", "obfs4", "scramblesuit".
* TRANSPORT is a string identifying a transport, e.g. "obfs3" or
"obfs4". Currently supported transport identifiers are:
"vanilla", "fte", "obfs3", "obfs4", "scramblesuit".
:rtype: list
:returns: The list of transports the client supports.
"""
......@@ -401,10 +401,10 @@ class CaptchaFetchResource(CaptchaResource):
encoded_data = request.content.read()
data = json.loads(encoded_data)["data"][0]
if data["type"] != "moat-transports":
if data["type"] != "client-transports":
raise ValueError(
"Bad JSON API object type: expected %s got %s" %
('moat-transports', data["type"]))
('client-transports', data["type"]))
elif data["version"] != MOAT_API_VERSION:
raise ValueError(
"Client requested protocol version %s, but we're using %s" %
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment