2828import firebase_functions .core as _core
2929from functions_framework import logging as _logging
3030
31- from flask import Request , Response , jsonify as _jsonify
31+ from flask import Request , Response , make_response as _make_response , jsonify as _jsonify
3232from flask_cors import cross_origin as _cross_origin
3333
3434
@@ -395,7 +395,7 @@ def _on_call_handler(func: _C2, request: Request) -> Response:
395395 "Firebase-Instance-ID-Token" ),
396396 )
397397 result = func (context )
398- return _jsonify (data = result , status = 200 )
398+ return _jsonify (result = result )
399399 # Disable broad exceptions lint since we want to handle all exceptions here
400400 # and wrap as an HttpsError.
401401 # pylint: disable=broad-except
@@ -404,7 +404,7 @@ def _on_call_handler(func: _C2, request: Request) -> Response:
404404 _logging .error ("Unhandled error" , err )
405405 err = HttpsError (FunctionsErrorCode .INTERNAL , "INTERNAL" )
406406 status = err ._http_error_code .status
407- return _jsonify (error = err ._as_dict (), status = status )
407+ return _make_response ( _jsonify (error = err ._as_dict ()), status )
408408
409409
410410@_util .copy_func_kwargs (_options .HttpsOptions )
0 commit comments