Skip to content
This repository was archived by the owner on Jan 12, 2020. It is now read-only.

Commit d561250

Browse files
committed
Changed function name from MethodOverride to Load
1 parent 60c22a7 commit d561250

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
```
99
var api rest.API
1010
11-
api.Use(methodoverride.MethodOverride())
11+
api.Use(methodoverride.Load())
1212
1313
```

method-override.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ func isValidMethod(method string) bool {
3131
/**
3232
* Method Override
3333
*/
34-
func MethodOverride() rest.Handler {
34+
func Load() rest.Handler {
3535
return func(ctx *rest.Context) {
3636
method := strings.ToUpper(ctx.Request.Header.Get(header))
3737
if method != "" && isValidMethod(method) {
38-
ctx.Set("original_method", ctx.Request.Method)
38+
ctx.Set("OriginalMethod", ctx.Request.Method)
3939
ctx.Request.Method = method
4040
}
4141
}

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.1-beta.1
1+
0.0.1-beta.2

0 commit comments

Comments
 (0)