title: abort method in Flask-Restful ignoring CORS options
body: <p>I have a Flask-Restful API configured with some CORS options:</p>
  
  <pre><code>api = Api()
  api.decorators=[cors.crossdomain(origin='*', headers=['accept', 'Content-Type'])]
  
  ...
  
  api.init_app(app)
  </code></pre>
  
  <p>My API accepts <code>POST</code> requests which may fail if the data in the request is invalid:</p>
  
  <pre><code>class myAPI(Resource):
      def post(self):
          args = request.get_json()
          if args.get('something'):
              return {'message': 'Request worked, data received!',
                      'something': args['something']}
          else:
              abort(500, "Error: Data must contain a 'something' field!")
  </code></pre>
  
  <p>When I make a successful <code>POST</code> request to my API I can see that the CORS options are properly set:</p>
  
  <pre><code>...
  * upload completely sent off: 81 out of 81 bytes
  * HTTP 1.0, assume close after body
  &lt; HTTP/1.0 200 OK
  &lt; Content-Type: application/json
  &lt; Content-Length: 205
  &lt; Access-Control-Allow-Origin: *
  &lt; Access-Control-Allow-Methods: HEAD, GET, POST, OPTIONS
  &lt; Access-Control-Max-Age: 21600
  &lt; Access-Control-Allow-Headers: ACCEPT, CONTENT-TYPE
  &lt; Server: Werkzeug/0.9.4 Python/2.7.6
  </code></pre>
  
  <p>If, however, the post call in my class exits through the abort method (by purposely sending bad data to the request) then the <code>Access-Control-*</code> fields are all missing from the response:</p>
  
  <pre><code>* upload completely sent off: 75 out of 75 bytes
  * HTTP 1.0, assume close after body
  &lt; HTTP/1.0 500 INTERNAL SERVER ERROR
  &lt; Content-Type: application/json
  &lt; Content-Length: 51
  &lt; Server: Werkzeug/0.9.4 Python/2.7.6
  </code></pre>
  
  <p>Is it possible to make the <code>abort</code> method play nice with my CORS rules, or should I create my own full-fledged response and avoid using the abort function?</p>