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

View File

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