Skip to content
Snippets Groups Projects
Commit b34d538f authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Add no-store, must-revalidate cache control options to client requests

parent 8a984b85
No related branches found
No related tags found
2 merge requests!39Merge release into master,!32Project/channels
...@@ -2,15 +2,17 @@ package connect ...@@ -2,15 +2,17 @@ package connect
import ( import (
"crypto/tls" "crypto/tls"
"git.xx.network/elixxir/grpc-web-go-client/grpcweb"
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"google.golang.org/grpc"
"net/http" "net/http"
"net/http/httptrace" "net/http/httptrace"
"regexp" "regexp"
"strings" "strings"
"time" "time"
"git.xx.network/elixxir/grpc-web-go-client/grpcweb"
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
) )
// WebConnParam struct holds parameters used // WebConnParam struct holds parameters used
...@@ -102,11 +104,15 @@ func (wc *webConn) connectWebHelper() (err error) { ...@@ -102,11 +104,15 @@ func (wc *webConn) connectWebHelper() (err error) {
backoffTime = 15000 backoffTime = 15000
} }
// ctx, cancel := newContext(time.Duration(backoffTime) * time.Millisecond) // ctx, cancel := newContext(time.Duration(backoffTime) * time.Millisecond)
md := &metadata.MD{}
md.Set("Cache-Control", "no-store, must-revalidate")
noCache := grpcweb.Header(md)
dialOpts := []grpcweb.DialOption{ dialOpts := []grpcweb.DialOption{
grpcweb.WithIdleConnTimeout(wc.h.params.WebParams.IdleConnTimeout), grpcweb.WithIdleConnTimeout(wc.h.params.WebParams.IdleConnTimeout),
grpcweb.WithExpectContinueTimeout(wc.h.params.WebParams.ExpectContinueTimeout), grpcweb.WithExpectContinueTimeout(wc.h.params.WebParams.ExpectContinueTimeout),
grpcweb.WithTlsHandshakeTimeout(wc.h.params.WebParams.TlsHandshakeTimeout), grpcweb.WithTlsHandshakeTimeout(wc.h.params.WebParams.TlsHandshakeTimeout),
grpcweb.WithDefaultCallOptions(noCache),
grpcweb.WithDefaultCallOptions(), // grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(math.MaxInt32)), grpcweb.WithDefaultCallOptions(), // grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(math.MaxInt32)),
} }
dialOpts = append(dialOpts, securityDial...) dialOpts = append(dialOpts, securityDial...)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment