Skip to content

Commit b573359

Browse files
authored
chore: fix typos (#20)
1 parent 4aaa653 commit b573359

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

examples/request-block/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ case_sensitive: false
3434
Based on this configuration, the following requests will be denied access:
3535
```bash
3636
curl http://example.com?foo=Bar
37-
curl http://exmaple.com/Swagger.html
37+
curl http://example.com/Swagger.html
3838
```
3939

4040
### Blocking Request Headers
@@ -47,7 +47,7 @@ block_headers:
4747
Based on this configuration, the following requests will be denied access:
4848
```bash
4949
curl http://example.com -H 'example-key: 123'
50-
curl http://exmaple.com -H 'my-header: example-value'
50+
curl http://example.com -H 'my-header: example-value'
5151
```
5252
5353
### Blocking Request Bodies
@@ -60,5 +60,5 @@ case_sensitive: false
6060
Based on this configuration, the following requests will be denied access:
6161
```bash
6262
curl http://example.com -d 'Hello World'
63-
curl http://exmaple.com -d 'hello world'
63+
curl http://example.com -d 'hello world'
6464
```

pkg/mcp/server/rest_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func (t *RestTool) parseTemplates() error {
217217
return errors.New("direct response mode must set responseTemplate.body")
218218
}
219219

220-
// Parse eror response template if present
220+
// Parse error response template if present
221221
if t.ErrorResponseTemplate != "" {
222222
t.parsedErrorResponseTemplate, err = template.New("errorResponse").Funcs(templateFuncs()).Parse(t.ErrorResponseTemplate)
223223
if err != nil {

pkg/wrapper/plugin_wrapper.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,12 +1021,12 @@ func (ctx *CommonHttpCtx[PluginConfig]) RouteCall(method, rawURL string, headers
10211021
callback(statusCode, responseHeaders, responseBody)
10221022
log.Infof("route call end, id:%s, code:%d, headers:%#v, body:%s", requestID, statusCode, responseHeaders, strings.ReplaceAll(string(responseBody), "\n", `\n`))
10231023
}
1024-
orignalMethod, _ := proxywasm.GetHttpRequestHeader(":method")
1025-
orignalPath, _ := proxywasm.GetHttpRequestHeader(":path")
1026-
orignalHost, _ := proxywasm.GetHttpRequestHeader(":authority")
1027-
proxywasm.ReplaceHttpRequestHeader("x-envoy-original-method", orignalMethod)
1028-
proxywasm.ReplaceHttpRequestHeader("x-envoy-original-path", orignalPath)
1029-
proxywasm.ReplaceHttpRequestHeader("x-envoy-original-host", orignalHost)
1024+
originalMethod, _ := proxywasm.GetHttpRequestHeader(":method")
1025+
originalPath, _ := proxywasm.GetHttpRequestHeader(":path")
1026+
originalHost, _ := proxywasm.GetHttpRequestHeader(":authority")
1027+
proxywasm.ReplaceHttpRequestHeader("x-envoy-original-method", originalMethod)
1028+
proxywasm.ReplaceHttpRequestHeader("x-envoy-original-path", originalPath)
1029+
proxywasm.ReplaceHttpRequestHeader("x-envoy-original-host", originalHost)
10301030

10311031
proxywasm.ReplaceHttpRequestHeader(":method", method)
10321032
parsedURL, err := url.Parse(rawURL)

pkg/wrapper/redis_wrapper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func RedisCall(cluster Cluster, respQuery []byte, callback RedisResponseCallback
143143
response, err := proxywasm.GetRedisCallResponse(0, responseSize)
144144
var responseValue resp.Value
145145
if status != 0 {
146-
proxywasm.LogCriticalf("Error occured while calling redis, it seems cannot connect to the redis cluster. request-id: %s", requestID)
146+
proxywasm.LogCriticalf("Error occurred while calling redis, it seems cannot connect to the redis cluster. request-id: %s", requestID)
147147
responseValue = resp.ErrorValue(fmt.Errorf("cannot connect to redis cluster"))
148148
} else {
149149
if err != nil {

0 commit comments

Comments
 (0)