~tribaal/txaws/xss-hardening

« back to all changes in this revision

Viewing changes to txaws/server/resource.py

  • Committer: Christopher Glass
  • Date: 2013-08-16 14:53:45 UTC
  • Revision ID: christopher.glass@canonical.com-20130816145345-o105i2uxycbyy0jd
Reduced code duplication and fixed deprecated assertEquals in tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
                body = safe_str(failure.value)
120
120
                status = 500
121
121
            request.setResponseCode(status)
122
 
            request.setHeader("Content-Type", self.content_type)
123
 
            request.write(escape(body, True))
124
 
            request.finish()
 
122
            write_response(escape(body, True))
125
123
 
126
124
        deferred.addCallback(write_response)
127
125
        deferred.addErrback(write_error)