Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct 'Content-Type' headers #6026

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions notebook/gateway/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,9 @@ async def start_kernel(self, kernel_id=None, path=None, **kwargs):

json_body = json_encode({'name': kernel_name, 'env': kernel_env})

response = await gateway_request(kernel_url, method='POST', body=json_body)
response = await gateway_request(
kernel_url, method='POST', headers={'Content-Type': 'application/json'}, body=json_body
kevin-bates marked this conversation as resolved.
Show resolved Hide resolved
)
kernel = json_decode(response.body)
kernel_id = kernel['id']
self.log.info("Kernel started: %s" % kernel_id)
Expand Down Expand Up @@ -489,7 +491,9 @@ async def restart_kernel(self, kernel_id, now=False, **kwargs):
"""
kernel_url = self._get_kernel_endpoint_url(kernel_id) + '/restart'
self.log.debug("Request restart kernel at: %s", kernel_url)
response = await gateway_request(kernel_url, method='POST', body=json_encode({}))
response = await gateway_request(
kernel_url, method='POST', headers={'Content-Type': 'application/json'}, body=json_encode({})
)
self.log.debug("Restart kernel response: %d %s", response.code, response.reason)

async def interrupt_kernel(self, kernel_id, **kwargs):
Expand All @@ -502,7 +506,9 @@ async def interrupt_kernel(self, kernel_id, **kwargs):
"""
kernel_url = self._get_kernel_endpoint_url(kernel_id) + '/interrupt'
self.log.debug("Request interrupt kernel at: %s", kernel_url)
response = await gateway_request(kernel_url, method='POST', body=json_encode({}))
response = await gateway_request(
kernel_url, method='POST', headers={'Content-Type': 'application/json'}, body=json_encode({})
)
self.log.debug("Interrupt kernel response: %d %s", response.code, response.reason)

def shutdown_all(self, now=False):
Expand Down