From 8be663a0a004a3efce264c231c7bb6d0fee640d3 Mon Sep 17 00:00:00 2001 From: jdl Date: Sun, 3 Dec 2023 20:24:36 +0100 Subject: [PATCH] Fix streaming handlers for https. --- lib/rep/http-handler.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/rep/http-handler.go b/lib/rep/http-handler.go index 843cb7a..05cd424 100644 --- a/lib/rep/http-handler.go +++ b/lib/rep/http-handler.go @@ -12,6 +12,13 @@ const ( pathStreamWAL = "stream-wal" ) +func (rep *Replicator) RegisterHandlers(mux *http.ServeMux, rootPath string) { + mux.HandleFunc(path.Join(rootPath, pathGetInfo), rep.handleGetInfo) + mux.HandleFunc(path.Join(rootPath, pathSendState), rep.handleSendState) + mux.HandleFunc(path.Join(rootPath, pathStreamWAL), rep.handleStreamWAL) +} + +// TODO: Remove this! func (rep *Replicator) Handle(w http.ResponseWriter, r *http.Request) { // We'll handle two types of requests: HTTP GET requests for JSON, or // streaming requets for state or wall.