Skip to content

Commit cc106ec

Browse files
authored
Merge pull request #18 from ethankhall/fix-api-name
Fix URL for posting
2 parents 6ce6e57 + 9c8d68b commit cc106ec

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/commands/nsq/api.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ lazy_static! {
2020
fn do_get(url: &str) -> Result<serde_json::Value, String> {
2121
let url = Url::parse(&url).expect("URL to be valid");
2222

23+
debug!("Making HTTP Call to {}", url);
24+
2325
HTTP_CLIENT
2426
.get(url)
2527
.send()
@@ -245,7 +247,7 @@ impl NsqState {
245247
self.host_details
246248
.values()
247249
.find(|host| host.topics.iter().any(|x| x == topic_name))
248-
.map(|x| format!("http://{}", x.hostname))
250+
.map(|x| format!("http://{}", x.base_url))
249251
}
250252
}
251253

src/commands/nsq/post.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ pub fn do_send_command(args: &ArgMatches) -> Result<(), CliError> {
132132
}
133133
};
134134

135+
debug!("Using {} as the base url", base_addresss);
136+
135137
let submit_url = format!("{}/pub?topic={}", base_addresss, &options.topic);
136138

137139
let pb = ProgressBarHelper::new(ProgressBarType::SizedProgressBar(

0 commit comments

Comments
 (0)