Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions server/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const (
HeaderUserAgent = "User-Agent"
// Header which communicates when a request was sent. Used to measure latency.
HeaderDateMilliseconds = "Date-Milliseconds"
// Header which communicates timeout set by client. Used to tweak block creation delay together with Date-Milliseconds.
HeaderTimeoutMs = "X-Timeout-Ms"

MediaTypeJSON = "application/json"
MediaTypeOctetStream = "application/octet-stream"
Expand Down
2 changes: 2 additions & 0 deletions server/get_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"mime"
"net/http"
"strconv"
"sync"
"time"

Expand Down Expand Up @@ -89,6 +90,7 @@ func (m *BoostService) getHeader(log *logrus.Entry, slot phase0.Slot, pubkey, pa
req.Header.Set(HeaderKeySlotUID, slotUID.String())
req.Header.Set(HeaderUserAgent, userAgent)
req.Header.Set(HeaderDateMilliseconds, startTime)
req.Header.Set(HeaderTimeoutMs, strconv.FormatInt(m.httpClientGetHeader.Timeout.Milliseconds(), 10))

// Send the request
log.Debug("requesting header")
Expand Down
Loading