Skip to content

Commit

Permalink
Generate DSId for RemoteObject response if request does not have one.
Browse files Browse the repository at this point in the history
  • Loading branch information
njoyce committed Jan 25, 2015
1 parent 4a09171 commit d4bda7c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pyamf/remoting/amf3.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def __call__(self, amf_request, **kwargs):
ro_request = amf_request.body[0]

try:
return self._getBody(amf_request, ro_request, **kwargs)
body = self._getBody(amf_request, ro_request, **kwargs)
except (KeyboardInterrupt, SystemExit):
raise
except:
Expand All @@ -229,6 +229,17 @@ def __call__(self, amf_request, **kwargs):
return remoting.Response(self.buildErrorResponse(ro_request),
status=remoting.STATUS_ERROR)

ro_response = body.body

dsid = ro_request.headers.get('DSId', None)

if not dsid or dsid == 'nil':
dsid = generate_random_id()

ro_response.headers.setdefault('DSId', dsid)

return body


def get_service_name(ro_request):
"""
Expand Down

0 comments on commit d4bda7c

Please sign in to comment.