Skip to content

Commit

Permalink
Added header content-type
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeyaprakash-NK committed Dec 20, 2024
1 parent d96964c commit 781fb6c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dataproc_jupyter_plugin/controllers/composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ async def get(self):
await credentials.get_cached(), self.log, client_session
)
environments = await client.list_environments()
if isinstance(environments, list):
self.finish(json.dumps(environments, default=lambda x: x.dict()))
else:
self.finish(environments)
self.set_header("Content-Type", "application/json")
self.finish(json.dumps(environments, default=lambda x: x.dict()))
except Exception as e:
self.log.exception(f"Error fetching composer environments: {str(e)}")
self.finish({"error": str(e)})

0 comments on commit 781fb6c

Please sign in to comment.