@@ -12,12 +12,22 @@ def lambda_handler(event, context):
1212 if user_id is None :
1313 return {
1414 'statusCode' : 400 ,
15+ 'headers' : {
16+ 'Content-Type' : 'application/json; charset=utf-8' ,
17+ 'Access-Control-Allow-Origin' : '*' ,
18+ 'Access-Control-Allow-Headers' : 'Content-Type'
19+ },
1520 'body' : json .dumps ('Missing user_id' )
1621 }
1722
1823 if blog_id is None :
1924 return {
2025 'statusCode' : 400 ,
26+ 'headers' : {
27+ 'Content-Type' : 'application/json; charset=utf-8' ,
28+ 'Access-Control-Allow-Origin' : '*' ,
29+ 'Access-Control-Allow-Headers' : 'Content-Type'
30+ },
2131 'body' : json .dumps ('Missing blog_id' )
2232 }
2333
@@ -29,7 +39,11 @@ def lambda_handler(event, context):
2939 if db_user is None :
3040 return {
3141 'statusCode' : 404 ,
32- 'headers' : {'Content-Type' : 'application/json; charset=utf-8' , 'Access-Control-Allow-Origin' : '*' },
42+ 'headers' : {
43+ 'Content-Type' : 'application/json; charset=utf-8' ,
44+ 'Access-Control-Allow-Origin' : '*' ,
45+ 'Access-Control-Allow-Headers' : 'Content-Type'
46+ },
3347 'body' : json .dumps ('User not found' )
3448 }
3549
@@ -39,7 +53,11 @@ def lambda_handler(event, context):
3953 if db_bookmark is None :
4054 return {
4155 'statusCode' : 404 ,
42- 'headers' : {'Content-Type' : 'application/json; charset=utf-8' , 'Access-Control-Allow-Origin' : '*' },
56+ 'headers' : {
57+ 'Content-Type' : 'application/json; charset=utf-8' ,
58+ 'Access-Control-Allow-Origin' : '*' ,
59+ 'Access-Control-Allow-Headers' : 'Content-Type'
60+ },
4361 'body' : json .dumps ('Bookmark not found' )
4462 }
4563
@@ -48,6 +66,10 @@ def lambda_handler(event, context):
4866
4967 return {
5068 'statusCode' : 204 ,
51- 'headers' : {'Content-Type' : 'application/json; charset=utf-8' , 'Access-Control-Allow-Origin' : '*' },
69+ 'headers' : {
70+ 'Content-Type' : 'application/json; charset=utf-8' ,
71+ 'Access-Control-Allow-Origin' : '*' ,
72+ 'Access-Control-Allow-Headers' : 'Content-Type'
73+ },
5274 'body' : ""
5375 }
0 commit comments