nteract / bookstore

📚 Notebook storage and publishing workflows for the masses
https://bookstore.readthedocs.io
BSD 3-Clause "New" or "Revised" License
201 stars 23 forks source link

Use paths not fully qualified domain names within bookstore #175

Closed mpacer closed 4 years ago

mpacer commented 4 years ago

Currently by creating the entire the entire domain name, our way of constructing urls is not compatible with a bunch of proxy setups.

Because we're not changing domain/origin with our links we can just use paths to define our redirect location and our api endpoint for the POST.

This switches us to use that logic.

As I went through making that change I discovered that our tests were not actually testing appropriately for the way that base_url and default_url on the Jupyter server work.

Because our tests would break when I switched us to using paths, I added the logic needed to match the behaviour expected by the Jupyter server & the Tornado application.

This primarily consisted of removing any cases where self.base_url did not begin and end with "/". That required