from flask import request, Blueprint, Response
from flask import current_app
import json

# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)


@general.route("/health")
def check_status():
    return Response(response=json.dumps({
        "app": "flask-skeleton-api",
        "status": "OK",
        "headers": str(request.headers),
        "commit": current_app.config["COMMIT"]
    }),  mimetype='application/json', status=200)



from flask import request, Blueprint, Response
from flask import current_app
import json

# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)


@general.route("/health")
def check_status():
    return Response(response=json.dumps({
        "app": "flask-skeleton-api",
        "status": "OK",
        "headers": request.headers.to_list(),
        "commit": current_app.config["COMMIT"]
    }),  mimetype='application/json', status=200)

Improve list of headers returned with health route in order to remove /r/n
Improve list of headers returned with health route in order to remove /r/n

  from flask import request, Blueprint, Response
  from flask import current_app
  import json
  
  # This is the blueprint object that gets registered into the app in blueprints.py.
  general = Blueprint('general', __name__)
  
  
  @general.route("/health")
  def check_status():
      return Response(response=json.dumps({
          "app": "flask-skeleton-api",
          "status": "OK",
-         "headers": str(request.headers),
+         "headers": request.headers.to_list(),
          "commit": current_app.config["COMMIT"]
      }),  mimetype='application/json', status=200)
  
- 
- 
Improve list of headers returned with health route in order to remove /r/n
## Code Before:
from flask import request, Blueprint, Response
from flask import current_app
import json

# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)


@general.route("/health")
def check_status():
    return Response(response=json.dumps({
        "app": "flask-skeleton-api",
        "status": "OK",
        "headers": str(request.headers),
        "commit": current_app.config["COMMIT"]
    }),  mimetype='application/json', status=200)



## Instruction:
Improve list of headers returned with health route in order to remove /r/n
## Code After:
from flask import request, Blueprint, Response
from flask import current_app
import json

# This is the blueprint object that gets registered into the app in blueprints.py.
general = Blueprint('general', __name__)


@general.route("/health")
def check_status():
    return Response(response=json.dumps({
        "app": "flask-skeleton-api",
        "status": "OK",
        "headers": request.headers.to_list(),
        "commit": current_app.config["COMMIT"]
    }),  mimetype='application/json', status=200)
