check status on upload, query escape cities for formatting maps uri format

This commit is contained in:
Bel LaPointe
2022-01-13 00:17:41 -05:00
parent 5170e96f7e
commit 1cc082083c
2 changed files with 8 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import (
"local/truckstop/config"
"local/truckstop/message"
"log"
"net/url"
"regexp"
"sort"
"strings"
@@ -311,7 +312,7 @@ func sendJob(job broker.Job) error {
}
maps := config.Get().Maps
if maps.Pickup {
pickup := fmt.Sprintf("%s,%s", job.Pickup.City, job.Pickup.State)
pickup := fmt.Sprintf("%s,%s", url.QueryEscape(job.Pickup.City), job.Pickup.State)
uri := fmt.Sprintf(maps.URIFormat, pickup, pickup)
log.Printf("sending pickup image: %s", uri)
if err := sender.SendImage(uri); err != nil {
@@ -319,7 +320,7 @@ func sendJob(job broker.Job) error {
}
}
if maps.Dropoff {
dropoff := fmt.Sprintf("%s,%s", job.Dropoff.City, job.Dropoff.State)
dropoff := fmt.Sprintf("%s,%s", url.QueryEscape(job.Dropoff.City), job.Dropoff.State)
uri := fmt.Sprintf(maps.URIFormat, dropoff, dropoff)
log.Printf("sending dropoff image: %s", uri)
if err := sender.SendImage(uri); err != nil {