##// END OF EJS Templates
fix Location headers
MinRK -
Show More
@@ -399,7 +399,7 b' class MainKernelHandler(IPythonHandler):'
399 notebook_id = self.get_argument('notebook', default=None)
399 notebook_id = self.get_argument('notebook', default=None)
400 kernel_id = km.start_kernel(notebook_id, cwd=nbm.notebook_dir)
400 kernel_id = km.start_kernel(notebook_id, cwd=nbm.notebook_dir)
401 data = {'ws_url':self.ws_url,'kernel_id':kernel_id}
401 data = {'ws_url':self.ws_url,'kernel_id':kernel_id}
402 self.set_header('Location', '/'+kernel_id)
402 self.set_header('Location', '{0}kernels/{1}'.format(self.base_kernel_url, kernel_id))
403 self.finish(jsonapi.dumps(data))
403 self.finish(jsonapi.dumps(data))
404
404
405
405
@@ -426,7 +426,7 b' class KernelActionHandler(IPythonHandler):'
426 if action == 'restart':
426 if action == 'restart':
427 km.restart_kernel(kernel_id)
427 km.restart_kernel(kernel_id)
428 data = {'ws_url':self.ws_url, 'kernel_id':kernel_id}
428 data = {'ws_url':self.ws_url, 'kernel_id':kernel_id}
429 self.set_header('Location', '/'+kernel_id)
429 self.set_header('Location', '{0}kernels/{1}'.format(self.base_kernel_url, kernel_id))
430 self.write(jsonapi.dumps(data))
430 self.write(jsonapi.dumps(data))
431 self.finish()
431 self.finish()
432
432
@@ -641,7 +641,7 b' class NotebookRootHandler(IPythonHandler):'
641 notebook_id = nbm.save_new_notebook(body, name=name, format=format)
641 notebook_id = nbm.save_new_notebook(body, name=name, format=format)
642 else:
642 else:
643 notebook_id = nbm.new_notebook()
643 notebook_id = nbm.new_notebook()
644 self.set_header('Location', '/'+notebook_id)
644 self.set_header('Location', '{0}notebooks/{1}'.format(self.base_project_url, notebook_id))
645 self.finish(jsonapi.dumps(notebook_id))
645 self.finish(jsonapi.dumps(notebook_id))
646
646
647
647
@@ -698,6 +698,9 b' class NotebookCheckpointsHandler(IPythonHandler):'
698 nbm = self.notebook_manager
698 nbm = self.notebook_manager
699 checkpoint = nbm.create_checkpoint(notebook_id)
699 checkpoint = nbm.create_checkpoint(notebook_id)
700 data = jsonapi.dumps(checkpoint, default=date_default)
700 data = jsonapi.dumps(checkpoint, default=date_default)
701 self.set_header('Location', '{0}notebooks/{1}/checkpoints/{2}'.format(
702 self.base_project_url, notebook_id, checkpoint['checkpoint_id']
703 ))
701
704
702 self.finish(data)
705 self.finish(data)
703
706
General Comments 0
You need to be logged in to leave comments. Login now