Skip bad CA

This commit is contained in:
Hamcha 2019-08-20 14:57:57 +02:00
parent c155adcbe0
commit 514574ef03
Signed by: hamcha
GPG key ID: 44AD3571EB09A39E
2 changed files with 6 additions and 2 deletions

View file

@ -62,7 +62,7 @@ type CardFaceFlipPics struct {
func webhook(update tg.APIUpdate) {
// Handle inline queries (99% of the usage I hope)
if update.Inline != nil {
if update.Inline != nil && update.Inline.Query != "" {
query := update.Inline.Query
results, err := mlpapiSearch(query)
if err != nil {
@ -205,7 +205,7 @@ func getCardEntry(card CardData, flipped int) (string, string, []tg.APIInlineKey
buttons := []tg.APIInlineKeyboardButton{
{
Text: "Ponyhead",
URL: "http://ponyhead.com/cards/" + cid,
URL: "https://ponyhead.com/cards/" + cid,
},
}

View file

@ -1,6 +1,7 @@
package main
import (
"crypto/tls"
"encoding/json"
"fmt"
"net/http"
@ -26,6 +27,9 @@ type CardData struct {
var netClient = &http.Client{
Timeout: time.Second * 20,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
}
func mlpapiSearch(query string) (results CardSearchResults, err error) {