Changing cosmos header checks to lower case

Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
This commit is contained in:
Ryan Lettieri 2022-09-09 14:08:45 -06:00
parent 34c24ba994
commit 97a91c0b8f
1 changed files with 3 additions and 2 deletions

View File

@ -22,6 +22,7 @@ import (
"fmt"
"net/http"
"strconv"
"strings"
"time"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
@ -87,9 +88,9 @@ type crossPartitionQueryPolicy struct{}
func (p *crossPartitionQueryPolicy) Do(req *policy.Request) (*http.Response, error) {
raw := req.Raw()
hdr := raw.Header
if hdr.Get("x-ms-documentdb-query") == "True" {
if strings.ToLower(hdr.Get("x-ms-documentdb-query")) == "true" {
// modify req here since we know it is a query
hdr.Add("x-ms-documentdb-query-enablecrosspartition", "True")
hdr.Add("x-ms-documentdb-query-enablecrosspartition", "true")
hdr.Del("x-ms-documentdb-partitionkey")
raw.Header = hdr