Skip to content

Commit 6ecf5c3

Browse files
authored
Merge pull request #37 from firebase/dl-callable-bug
fix: conform to protocol specification for https oncall function
2 parents ccbc179 + 91e48f7 commit 6ecf5c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/firebase_functions/https.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import firebase_functions.core as _core
2929
from 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
3232
from 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

Comments
 (0)