Files
bash-it/plugins/available
Alex Thiessen 7a83c56d3a plugins/base: Detect HTTP errors in myip()
Out of the box, `curl` reports success (via exit code) even if the
server returns an error, e.g. _429 Too Many Requests_ which was
sometimes the case with `http://myip.dnsomatic.com`. So, errors went
undetected.

There is the `--fail` switch which enables us to use the exit code the
way we need:

> -f, --fail
>        (HTTP) Fail  silently  (no  output  at  all)  on  server
>        errors. This is mostly done to better enable scripts etc
>        to better deal with failed  attempts.  In  normal  cases
>        when  an  HTTP  server  fails  to deliver a document, it
>        returns an HTML document stating so  (which  often  also
>        describes  why  and  more).  This flag will prevent curl
>        from outputting that and return error 22.

Use it to make the `myip()` deliver results reliably.
2020-04-07 00:01:09 +02:00
..
2019-04-11 10:57:04 +02:00
2015-10-21 09:25:52 +02:00
2012-05-13 22:13:54 -04:00
2020-03-10 23:02:33 -07:00
2017-12-11 08:43:53 +01:00
2017-05-19 10:11:54 -06:00
2015-06-18 11:51:51 -04:00
2016-06-27 15:02:34 -05:00
2020-03-25 11:29:12 -07:00
2012-05-13 22:13:54 -04:00
2015-09-06 19:18:14 +02:00
2012-05-21 11:50:01 +02:00
2012-05-13 22:13:54 -04:00
2020-02-03 15:37:54 -07:00
2019-10-07 14:19:38 +02:00
2019-11-27 18:01:28 +05:30
2019-04-04 17:51:32 -04:00
2016-05-23 08:45:46 +02:00
2020-02-16 15:44:50 +08:00
2020-02-16 12:38:14 +01:00
2016-04-26 09:20:45 +02:00