28
28
import firebase_functions .core as _core
29
29
from functions_framework import logging as _logging
30
30
31
- from flask import Request , Response , jsonify as _jsonify
31
+ from flask import Request , Response , make_response as _make_response , jsonify as _jsonify
32
32
from flask_cors import cross_origin as _cross_origin
33
33
34
34
@@ -395,7 +395,7 @@ def _on_call_handler(func: _C2, request: Request) -> Response:
395
395
"Firebase-Instance-ID-Token" ),
396
396
)
397
397
result = func (context )
398
- return _jsonify (data = result , status = 200 )
398
+ return _jsonify (result = result )
399
399
# Disable broad exceptions lint since we want to handle all exceptions here
400
400
# and wrap as an HttpsError.
401
401
# pylint: disable=broad-except
@@ -404,7 +404,7 @@ def _on_call_handler(func: _C2, request: Request) -> Response:
404
404
_logging .error ("Unhandled error" , err )
405
405
err = HttpsError (FunctionsErrorCode .INTERNAL , "INTERNAL" )
406
406
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 )
408
408
409
409
410
410
@_util .copy_func_kwargs (_options .HttpsOptions )
0 commit comments