Skip to content

Commit

Permalink
fix(synthetics): alter []SyntheticsCustomHeaderInput to allow empty c…
Browse files Browse the repository at this point in the history
…ustom headers in the request (#1203)
  • Loading branch information
vagrawal-newrelic authored Aug 7, 2024
1 parent c06b729 commit 61a9215
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions pkg/synthetics/synthetics_api_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestSyntheticsSimpleBrowserMonitor_Basic(t *testing.T) {
AdvancedOptions: SyntheticsSimpleBrowserMonitorAdvancedOptionsInput{
EnableScreenshotOnFailureAndScript: &tv,
ResponseValidationText: "SUCCESS",
CustomHeaders: []SyntheticsCustomHeaderInput{
CustomHeaders: &[]SyntheticsCustomHeaderInput{
{
Name: "Monitor",
Value: "synthetics",
Expand All @@ -110,7 +110,7 @@ func TestSyntheticsSimpleBrowserMonitor_Basic(t *testing.T) {

simpleBrowserMonitorInputUpdated := SyntheticsUpdateSimpleBrowserMonitorInput{
AdvancedOptions: SyntheticsSimpleBrowserMonitorAdvancedOptionsInput{
CustomHeaders: []SyntheticsCustomHeaderInput{
CustomHeaders: &[]SyntheticsCustomHeaderInput{
{
Name: "Monitor",
Value: "Synthetics",
Expand Down Expand Up @@ -171,7 +171,7 @@ func TestSyntheticsSimpleMonitor_Basic(t *testing.T) {

simpleMonitorInput := SyntheticsCreateSimpleMonitorInput{
AdvancedOptions: SyntheticsSimpleMonitorAdvancedOptionsInput{
CustomHeaders: []SyntheticsCustomHeaderInput{
CustomHeaders: &[]SyntheticsCustomHeaderInput{
{
Name: "Monitor",
Value: "Synthetics",
Expand Down Expand Up @@ -209,7 +209,7 @@ func TestSyntheticsSimpleMonitor_Basic(t *testing.T) {

simpleMonitorInputUpdated := SyntheticsUpdateSimpleMonitorInput{
AdvancedOptions: SyntheticsSimpleMonitorAdvancedOptionsInput{
CustomHeaders: []SyntheticsCustomHeaderInput{
CustomHeaders: &[]SyntheticsCustomHeaderInput{
{
Name: "Monitors",
Value: "Synthetics",
Expand Down Expand Up @@ -1090,7 +1090,7 @@ func TestSyntheticsStartAutomatedTest_Basic(t *testing.T) {
AdvancedOptions: SyntheticsSimpleBrowserMonitorAdvancedOptionsInput{
EnableScreenshotOnFailureAndScript: &tv,
ResponseValidationText: "SUCCESS",
CustomHeaders: []SyntheticsCustomHeaderInput{
CustomHeaders: &[]SyntheticsCustomHeaderInput{
{
Name: "Monitor",
Value: "synthetics",
Expand All @@ -1104,7 +1104,7 @@ func TestSyntheticsStartAutomatedTest_Basic(t *testing.T) {
monitorThreeName := fmt.Sprintf("%s-syntheticsStartAutomatedTest", generateSyntheticsEntityNameForIntegrationTest("MONITOR", false))
monitorThreeInput := SyntheticsCreateSimpleMonitorInput{
AdvancedOptions: SyntheticsSimpleMonitorAdvancedOptionsInput{
CustomHeaders: []SyntheticsCustomHeaderInput{
CustomHeaders: &[]SyntheticsCustomHeaderInput{
{
Name: monitorThreeName,
Value: "Synthetics",
Expand Down
4 changes: 2 additions & 2 deletions pkg/synthetics/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ type SyntheticsSimpleBrowserMonitorAdvancedOptions struct {
// SyntheticsSimpleBrowserMonitorAdvancedOptionsInput - The advanced options inputs available for a Simple Browser monitor
type SyntheticsSimpleBrowserMonitorAdvancedOptionsInput struct {
// Custom headers to use in monitor job
CustomHeaders []SyntheticsCustomHeaderInput `json:"customHeaders,omitempty"`
CustomHeaders *[]SyntheticsCustomHeaderInput `json:"customHeaders,omitempty"`
// Emulate a device
DeviceEmulation *SyntheticsDeviceEmulationInput `json:"deviceEmulation,omitempty"`
// Capture a screenshot during job execution
Expand Down Expand Up @@ -1632,7 +1632,7 @@ type SyntheticsSimpleMonitorAdvancedOptions struct {
// SyntheticsSimpleMonitorAdvancedOptionsInput - The advanced options inputs available for a Simple (ping) monitor
type SyntheticsSimpleMonitorAdvancedOptionsInput struct {
// Custom headers to use in monitor job
CustomHeaders []SyntheticsCustomHeaderInput `json:"customHeaders,omitempty"`
CustomHeaders *[]SyntheticsCustomHeaderInput `json:"customHeaders,omitempty"`
// Categorize redirects during a monitor job as a failure
RedirectIsFailure *bool `json:"redirectIsFailure,omitempty"`
// Validation text for monitor to search for at given URI
Expand Down

0 comments on commit 61a9215

Please sign in to comment.