matrix-org / matrix-appservice-irc

Node.js IRC bridge for Matrix
Apache License 2.0
461 stars 149 forks source link

Fix provisioning API base URL in setup widgets #1677

Closed justinbot closed 1 year ago

justinbot commented 1 year ago

Fixes how the setup widget determines the API base URL to use, in order to support hosting on different paths. e.g. https://example.com/irc/_matrix/provision/v1/static -> https://example.com/irc/_matrix/provision

This takes advantage of the widget always being hosted at /v1/static, so we can just strip that to get the base URL: https://github.com/matrix-org/matrix-appservice-bridge/blob/7ecbe69fb86e92851af3946135867357e8866743/src/provisioning/api.ts#L166-L167