Skip to content

Commit 381f3e0

Browse files
authored
Merge pull request #40 from unistack-org/master
merge master
2 parents e8f7fab + 757c458 commit 381f3e0

File tree

5 files changed

+31
-15
lines changed

5 files changed

+31
-15
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: "codeql"
1313

1414
on:
1515
workflow_run:
@@ -26,7 +26,7 @@ on:
2626

2727
jobs:
2828
analyze:
29-
name: Analyze
29+
name: analyze
3030
runs-on: ubuntu-latest
3131
permissions:
3232
actions: read
@@ -42,11 +42,14 @@ jobs:
4242
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
4343

4444
steps:
45-
- name: Checkout repository
45+
- name: checkout
4646
uses: actions/checkout@v2
47-
47+
- name: setup
48+
uses: actions/setup-go@v2
49+
with:
50+
go-version: 1.16
4851
# Initializes the CodeQL tools for scanning.
49-
- name: Initialize CodeQL
52+
- name: init
5053
uses: github/codeql-action/init@v1
5154
with:
5255
languages: ${{ matrix.language }}
@@ -57,7 +60,7 @@ jobs:
5760

5861
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5962
# If this step fails, then you should remove it and run the build manually (see below)
60-
- name: Autobuild
63+
- name: autobuild
6164
uses: github/codeql-action/autobuild@v1
6265

6366
# ℹ️ Command-line programs to run using the OS shell.
@@ -71,5 +74,5 @@ jobs:
7174
# make bootstrap
7275
# make release
7376

74-
- name: Perform CodeQL Analysis
77+
- name: analyze
7578
uses: github/codeql-action/analyze@v1

.github/workflows/dependabot-automerge.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@ jobs:
1313
runs-on: ubuntu-latest
1414
if: ${{ github.actor == 'dependabot[bot]' }}
1515
steps:
16-
- name: Dependabot metadata
16+
- name: metadata
1717
id: metadata
1818
uses: dependabot/fetch-metadata@v1.1.1
1919
with:
2020
github-token: "${{ secrets.TOKEN }}"
21-
- name: Enable auto-merge for Dependabot PRs
21+
- name: approve
22+
run: gh pr review --approve "$PR_URL"
23+
env:
24+
PR_URL: ${{github.event.pull_request.html_url}}
25+
GITHUB_TOKEN: ${{secrets.TOKEN}}
26+
- name: merge
2227
if: ${{contains(steps.metadata.outputs.dependency-names, 'go.unistack.org')}}
2328
run: gh pr merge --auto --merge "$PR_URL"
2429
env:

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module go.unistack.org/micro-client-http/v3
22

33
go 1.16
44

5-
require go.unistack.org/micro/v3 v3.8.5
5+
require go.unistack.org/micro/v3 v3.8.12

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTK
88
github.com/silas/dag v0.0.0-20210626123444-3804bac2d6d4/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I=
99
go.unistack.org/micro-proto/v3 v3.1.0 h1:q39FwjFiRZn+Ux/tt+d3bJTmDtsQQWa+3SLYVo1vLfA=
1010
go.unistack.org/micro-proto/v3 v3.1.0/go.mod h1:DpRhYCBXlmSJ/AAXTmntvlh7kQkYU6eFvlmYAx4BQS8=
11-
go.unistack.org/micro/v3 v3.8.5 h1:DIYWRsQF+NPhKZP45sCtNsUhaRw6u2+Ps7U+pKU7i3s=
12-
go.unistack.org/micro/v3 v3.8.5/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA=
11+
go.unistack.org/micro/v3 v3.8.12 h1:ACaHE8ZIHFXqEGPSRvXzND4hcqCSQf04WkzOFY6Y1gQ=
12+
go.unistack.org/micro/v3 v3.8.12/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA=
1313
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
1414
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
1515
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

message.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,28 @@ package http
22

33
import (
44
"go.unistack.org/micro/v3/client"
5+
"go.unistack.org/micro/v3/metadata"
56
)
67

78
type httpMessage struct {
89
payload interface{}
910
topic string
1011
contentType string
12+
opts client.MessageOptions
1113
}
1214

1315
func newHTTPMessage(topic string, payload interface{}, contentType string, opts ...client.MessageOption) client.Message {
1416
options := client.NewMessageOptions(opts...)
15-
if len(options.ContentType) == 0 {
16-
options.ContentType = contentType
17+
18+
if len(options.ContentType) > 0 {
19+
contentType = options.ContentType
1720
}
1821

1922
return &httpMessage{
2023
payload: payload,
2124
topic: topic,
22-
contentType: options.ContentType,
25+
contentType: contentType,
26+
opts: options,
2327
}
2428
}
2529

@@ -34,3 +38,7 @@ func (h *httpMessage) Topic() string {
3438
func (h *httpMessage) Payload() interface{} {
3539
return h.payload
3640
}
41+
42+
func (h *httpMessage) Metadata() metadata.Metadata {
43+
return h.opts.Metadata
44+
}

0 commit comments

Comments
 (0)