JoinMarket-Org / joinmarket-clientserver

Bitcoin CoinJoin implementation with incentive structure to convince people to take part
GNU General Public License v3.0
699 stars 173 forks source link

ob-watcher.py: Redirect back to `/` after `/refreshorderbook` and `/rotateOb` #1685

Closed kristapsk closed 1 month ago

kristapsk commented 3 months ago

Fixes #1684.

kristapsk commented 3 months ago

changing the unit or percentage (after refresh) can also update the orderbook (sometimes), is that ok?

Yes, same will happen if you will just refresh the page. What /refreshorderbook does is that it deletes all already gathered information from in-memory sqlite database and starts from scratch. But new orders are added and old removed when makers join and leave independently from that.

kristapsk commented 3 months ago

Need to test does this work when there is reverse proxy in front and actual URL base is not /, but something else, like with https://nixbitcoin.org/orderbook/.

kristapsk commented 3 months ago

Should do the same with /rotateOb.

kristapsk commented 1 month ago

Addressed my last two comments about handling proxied situations when URI base path isn't / and also modified /rotateOb too (but current way of doing that also isn't perfect, it modifies global state, should maybe use client side cookie instead).

theborakompanioni commented 1 month ago

Just for the record: That was a breaking change. Status 302 Found instead of 200 OK might break client behaviour (as it did in Jam - fetch in a browser environment does follow redirects automatically - it starting a local reverse proxy was not setup to subsequently fetch from 127.0.0.1:62601 without adaptions).