Repository: opensearch-project/opensearch-go
Pull request #228 (2023-02-06 23:15:32)

Bump github.com/aws/aws-sdk-go from 1.44.185 to 1.44.195
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.185 to 1.44.195.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/aws/aws-sdk-go/releases">github.com/aws/aws-sdk-go's releases</a>.</em></p>
<blockquote>
<h1>Release v1.44.195 (2023-02-06)</h1>
<h3>Service Client Updates</h3>
<ul>
<li><code>service/compute-optimizer</code>: Updates service API and documentation</li>
<li><code>service/customer-profiles</code>: Updates service API and documentation</li>
<li><code>service/frauddetector</code>: Updates service API and documentation</li>
<li><code>service/mediaconvert</code>: Updates service API and documentation
<ul>
<li>The AWS Elemental MediaConvert SDK has added improved scene change detection capabilities and a bandwidth reduction filter, along with video quality enhancements, to the AVC encoder.</li>
</ul>
</li>
<li><code>service/outposts</code>: Updates service API and documentation</li>
</ul>
<h1>Release v1.44.194 (2023-02-03)</h1>
<h3>Service Client Updates</h3>
<ul>
<li><code>service/proton</code>: Updates service API and documentation</li>
<li><code>service/redshift</code>: Updates service documentation
<ul>
<li>Corrects descriptions of the parameters for the API operations RestoreFromClusterSnapshot, RestoreTableFromClusterSnapshot, and CreateCluster.</li>
</ul>
</li>
</ul>
<h1>Release v1.44.193 (2023-02-02)</h1>
<h3>Service Client Updates</h3>
<ul>
<li><code>service/appconfig</code>: Updates service API and documentation</li>
<li><code>service/connect</code>: Adds new service</li>
<li><code>service/ec2</code>: Updates service API and documentation
<ul>
<li>Documentation updates for EC2.</li>
</ul>
</li>
<li><code>service/elasticloadbalancingv2</code>: Updates service documentation</li>
<li><code>service/keyspaces</code>: Adds new service</li>
<li><code>service/quicksight</code>: Updates service API and documentation
<ul>
<li>QuickSight support for Radar Chart and Dashboard Publish Options</li>
</ul>
</li>
<li><code>service/redshift</code>: Adds new service
<ul>
<li>Enabled FIPS endpoints for GovCloud (US) regions in SDK.</li>
</ul>
</li>
<li><code>service/sso-admin</code>: Adds new service</li>
</ul>
<h1>Release v1.44.192 (2023-02-01)</h1>
<h3>Service Client Updates</h3>
<ul>
<li><code>service/devops-guru</code>: Updates service API and documentation</li>
<li><code>service/forecast</code>: Updates service API and documentation</li>
<li><code>service/iam</code>: Updates service documentation
<ul>
<li>Documentation updates for AWS Identity and Access Management (IAM).</li>
</ul>
</li>
<li><code>service/mediatailor</code>: Updates service API and documentation</li>
<li><code>service/sns</code>: Updates service documentation
<ul>
<li>Additional attributes added for set-topic-attributes.</li>
</ul>
</li>
</ul>
<h1>Release v1.44.191 (2023-01-31)</h1>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/aws/aws-sdk-go/commit/5707eba1610d563b9c563dbc862587649bcb9811"><code>5707eba</code></a> Release v1.44.195 (2023-02-06) (<a href="https://github-redirect.dependabot.com/aws/aws-sdk-go/issues/4717">#4717</a>)</li>
<li><a href="https://github.com/aws/aws-sdk-go/commit/740c2dd94c8d75423d045be60a10384107376268"><code>740c2dd</code></a> Release v1.44.194 (2023-02-03) (<a href="https://github-redirect.dependabot.com/aws/aws-sdk-go/issues/4715">#4715</a>)</li>
<li><a href="https://github.com/aws/aws-sdk-go/commit/52661d03b4be002f6e88f8079e1e868f9b85f720"><code>52661d0</code></a> Release v1.44.193 (2023-02-02) (<a href="https://github-redirect.dependabot.com/aws/aws-sdk-go/issues/4714">#4714</a>)</li>
<li><a href="https://github.com/aws/aws-sdk-go/commit/9fac3673d9126d28dd6c24b25924ceafd214c3ce"><code>9fac367</code></a> Release v1.44.192 (2023-02-01) (<a href="https://github-redirect.dependabot.com/aws/aws-sdk-go/issues/4712">#4712</a>)</li>
<li><a href="https://github.com/aws/aws-sdk-go/commit/4d8fb842b89848f744f8b194ff0ed8c2eff29091"><code>4d8fb84</code></a> Release v1.44.191 (2023-01-31) (<a href="https://github-redirect.dependabot.com/aws/aws-sdk-go/issues/4710">#4710</a>)</li>
<li><a href="https://github.com/aws/aws-sdk-go/commit/76684dd605f286b3b0a234877c64bf0e16515308"><code>76684dd</code></a> Release v1.44.190 (2023-01-30) (<a href="https://github-redirect.dependabot.com/aws/aws-sdk-go/issues/4707">#4707</a>)</li>
<li><a href="https://github.com/aws/aws-sdk-go/commit/d4386d55dd49bf6589e9460f9322fd2fbf904b39"><code>d4386d5</code></a> Release v1.44.189 (2023-01-27) (<a href="https://github-redirect.dependabot.com/aws/aws-sdk-go/issues/4706">#4706</a>)</li>
<li><a href="https://github.com/aws/aws-sdk-go/commit/61bd8adb750a7d177e406e09f46c3795bcb6b4e9"><code>61bd8ad</code></a> Release v1.44.188 (2023-01-26) (<a href="https://github-redirect.dependabot.com/aws/aws-sdk-go/issues/4705">#4705</a>)</li>
<li><a href="https://github.com/aws/aws-sdk-go/commit/bf09a2d81c0a2aa4c82ca526de06601ea0f27106"><code>bf09a2d</code></a> Release v1.44.187 (2023-01-25) (<a href="https://github-redirect.dependabot.com/aws/aws-sdk-go/issues/4704">#4704</a>)</li>
<li><a href="https://github.com/aws/aws-sdk-go/commit/38cb3b89d672b8b6de06495f0cd45f7fd3cdc9c2"><code>38cb3b8</code></a> fix misleading timestamp value from tests and lint issues (<a href="https://github-redirect.dependabot.com/aws/aws-sdk-go/issues/4699">#4699</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/aws/aws-sdk-go/compare/v1.44.185...v1.44.195">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/aws/aws-sdk-go&package-manager=go_modules&previous-version=1.44.185&new-version=1.44.195)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e427151..5e9ea23 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 - Bumps `github.com/aws/aws-sdk-go-v2/config` from 1.18.9 to 1.18.12
 - Bumps `github.com/aws/aws-sdk-go-v2/config` from 1.18.8 to 1.18.10
 - Bumps `github.com/aws/aws-sdk-go-v2/config` from 1.17.10 to 1.18.9
-- Bumps `github.com/aws/aws-sdk-go` from 1.44.180 to 1.44.185
+- Bumps `github.com/aws/aws-sdk-go` from 1.44.185 to 1.44.195
+- Bumps `github.com/aws/aws-sdk-go` from 1.44.180 to 1.44.195
 - Bumps `github.com/aws/aws-sdk-go` from 1.44.176 to 1.44.185
 - Bumps `github.com/aws/aws-sdk-go` from 1.44.132 to 1.44.180
 
@@ -31,8 +32,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ### Fixed
  - Renamed the sequence number struct tag to if_seq_no to fix optimistic concurrency control ([#166](https://github.com/opensearch-project/opensearch-go/pull/166))
  - Fix `RetryOnConflict` on bulk indexer ([#215](https://github.com/opensearch-project/opensearch-go/pull/215))
+ - Correct curl logging to emit the correct URL destination ([#101](https://github.com/opensearch-project/opensearch-go/pull/101))
 
 ### Security
 
 
-[Unreleased]: https://github.com/opensearch-project/opensearch-go/compare/2.1...HEAD
\ No newline at end of file
+[Unreleased]: https://github.com/opensearch-project/opensearch-go/compare/2.1...HEAD
diff --git a/go.mod b/go.mod
index 79f3eef..e279b7b 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/opensearch-project/opensearch-go/v2
 go 1.15
 
 require (
-	github.com/aws/aws-sdk-go v1.44.185
+	github.com/aws/aws-sdk-go v1.44.195
 	github.com/aws/aws-sdk-go-v2 v1.17.4
 	github.com/aws/aws-sdk-go-v2/config v1.18.12
 	github.com/stretchr/testify v1.8.1
diff --git a/go.sum b/go.sum
index a91c40d..f78cdd8 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,5 @@
-github.com/aws/aws-sdk-go v1.44.185 h1:stasiou+Ucx2A0RyXRyPph4sLCBxVQK7DPPK8tNcl5g=
-github.com/aws/aws-sdk-go v1.44.185/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
+github.com/aws/aws-sdk-go v1.44.195 h1:d5xFL0N83Fpsq2LFiHgtBUHknCRUPGHdOlCWt/jtOJs=
+github.com/aws/aws-sdk-go v1.44.195/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
 github.com/aws/aws-sdk-go-v2 v1.17.4 h1:wyC6p9Yfq6V2y98wfDsj6OnNQa4w2BLGCLIxzNhwOGY=
 github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw=
 github.com/aws/aws-sdk-go-v2/config v1.18.12 h1:fKs/I4wccmfrNRO9rdrbMO1NgLxct6H9rNMiPdBxHWw=
diff --git a/opensearchtransport/logger.go b/opensearchtransport/logger.go
index 223b016..f089e9e 100644
--- a/opensearchtransport/logger.go
+++ b/opensearchtransport/logger.go
@@ -248,8 +248,12 @@ func (l *CurlLogger) LogRoundTrip(req *http.Request, res *http.Response, err err
 		}
 	}
 
-	b.WriteString(" 'http://localhost:9200")
-	b.WriteString(req.URL.Path)
+	// If by some oddity we end up with a nil req.URL, we handle it gracefully.
+	if req.URL == nil {
+		b.WriteString(" '")
+	} else {
+		b.WriteString(fmt.Sprintf(" '%s://%s%s", req.URL.Scheme, req.URL.Host, req.URL.Path))
+	}
 	b.WriteString("?pretty")
 	if query != "" {
 		fmt.Fprintf(&b, "&%s", query)


Test patch:
diff --git a/opensearchtransport/logger_internal_test.go b/opensearchtransport/logger_internal_test.go
index c5d7e7b..27beae7 100644
--- a/opensearchtransport/logger_internal_test.go
+++ b/opensearchtransport/logger_internal_test.go
@@ -285,7 +285,7 @@ func TestTransportLogger(t *testing.T) {
 			t.Fatalf("Expected 9 lines, got %d", len(lines))
 		}
 
-		if !strings.Contains(lines[0], "curl -X GET 'http://localhost:9200/abc?pretty&q=a%2Cb'") {
+		if !strings.Contains(lines[0], "curl -X GET 'http://foo/abc?pretty&q=a%2Cb'") {
 			t.Errorf("Unexpected output: %s", lines[0])
 		}
 	})