Use more precise timestamp

This commit is contained in:
Spotlight 2020-08-18 22:35:13 -05:00
parent a3355a7b69
commit de5c682dd5
No known key found for this signature in database
GPG Key ID: 874AA355B3209BDC

View File

@ -20,10 +20,10 @@ package main
import ( import (
"encoding/xml" "encoding/xml"
"errors" "errors"
"fmt"
"github.com/antchfx/xmlquery" "github.com/antchfx/xmlquery"
"io" "io"
"regexp" "regexp"
"strconv"
"time" "time"
) )
@ -47,7 +47,7 @@ func parseAction(original string) (string, string) {
// NewEnvelope returns a new Envelope with proper attributes initialized. // NewEnvelope returns a new Envelope with proper attributes initialized.
func NewEnvelope(service string, action string) Envelope { func NewEnvelope(service string, action string) Envelope {
// Get a sexy new timestamp to use. // Get a sexy new timestamp to use.
timestampNano := strconv.FormatInt(time.Now().UTC().Unix(), 10) + "000" timestampNano := fmt.Sprint(time.Now().UTC().UnixNano())[0:13]
return Envelope{ return Envelope{
SOAPEnv: "http://schemas.xmlsoap.org/soap/envelope/", SOAPEnv: "http://schemas.xmlsoap.org/soap/envelope/",