Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra quote in pushover message #37

Closed
reinoud opened this issue Apr 4, 2024 · 6 comments
Closed

extra quote in pushover message #37

reinoud opened this issue Apr 4, 2024 · 6 comments

Comments

@reinoud
Copy link

reinoud commented Apr 4, 2024

in my configuration I have stated https{url="https://mywebsite.com"}

When I get an alert (with Pushover) I get the alert:

https: [ipv4] Unable to retrieve URL 'https://mywebsite.com': SSL peer certificate or SSH remote key was not OK
In the (iPhone) Pushover app, the URL is a clickable link. When I click that link, the browser tries to open

https://snappass.leeuwen.net'
(including the extra ' at the end), which is not a valid URL.

@jpmens
Copy link
Contributor

jpmens commented Apr 4, 2024

I don't see the single quote anywhere in the source, but I'm not familiar with it either.

Are you sure it's not part of the payload you're transmitting? An example would possible help.

@job
Copy link
Contributor

job commented Apr 4, 2024

I think the single quotes are set here: https://github.com/berthubert/simplomon/blob/main/minicurl.cc#L147

@job
Copy link
Contributor

job commented Apr 4, 2024

@reinoud does this fix it?

diff --git minicurl.cc minicurl.cc
index f4fad29..90c236d 100644
--- minicurl.cc
+++ minicurl.cc
@@ -144,7 +144,7 @@ std::string MiniCurl::getURL(const std::string& str, const bool nobody, MiniCurl
     d_host_list = nullptr;
   }
   if(res != CURLE_OK)  {
-    throw std::runtime_error("Unable to retrieve URL '"+str+ "': "+string(curl_easy_strerror(res)));
+    throw std::runtime_error("Unable to retrieve URL " + str + " : " + string(curl_easy_strerror(res)));
   }
 
   d_filetime=-1;

@jpmens
Copy link
Contributor

jpmens commented Apr 4, 2024

Thanks, @job; goes to show I should shut up when clueless. I might have been thrown by OP saying "clickable link in the Pushover app", hence my thinking it was the payload, not taking into account the payload is generated.

@reinoud
Copy link
Author

reinoud commented Apr 4, 2024

sorry for the confusion, I tried to not make any assumptions. So I did my best to describe the exact problem :-)

@reinoud
Copy link
Author

reinoud commented Apr 4, 2024

@reinoud does this fix it?

I don't have a build environment here so I cannot test it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants