Skip to content
Snippets Groups Projects
Commit f54e43ef authored by Mikhail Karnevskiy's avatar Mikhail Karnevskiy
Browse files

Add default value for flag detailed of the get_stream_list request value:...

Add default value for flag detailed of the get_stream_list request value: true. This will restore back-compatibility with old consumer library.
parent b428a8d1
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ var testsGetCommand = []struct {
expectedGroupID + "/next", "&resend_nacks=true&delay_ms=10000&resend_attempts=3", "{\"id_key\":\"_id\",\"resend\":true,\"delay_ms\":10000,\"resend_attempts\":3}"},
{"size", expectedSource, expectedStream, "", expectedStream + "/size", "", ""},
{"size", expectedSource, expectedStream, "", expectedStream + "/size", "&incomplete=true", "true"},
{"streams", expectedSource, "0", "", "0/streams", "", "{\"from\":\"\",\"filter\":\"\",\"detailed\":\"\"}"},
{"streams", expectedSource, "0", "", "0/streams", "", "{\"from\":\"\",\"filter\":\"\",\"detailed\":\"true\"}"},
{"lastack", expectedSource, expectedStream, expectedGroupID, expectedStream + "/" + expectedGroupID + "/lastack", "", ""},
{"datasources", expectedSource, "0", "", "0/sources", "", ""},
}
......
......@@ -10,9 +10,14 @@ type GetStreamsParams = database.GetStreamsParams
func routeGetStreams(w http.ResponseWriter, r *http.Request) {
keys := r.URL.Query()
// Use true as for back compatibility
detailed := keys.Get("detailed")
if detailed == "" {
detailed = "true"
}
extraParams := GetStreamsParams{From: keys.Get("from"),
Filter: keys.Get("filter"),
Detailed: keys.Get("detailed")}
Detailed: detailed}
encoded, _ := json.Marshal(extraParams)
processRequest(w, r, "streams", string(encoded), false)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment