isValidMethod reports whether method is a known HTTP method.
(method string)
| 214 | |
| 215 | // isValidMethod reports whether method is a known HTTP method. |
| 216 | func isValidMethod(method string) bool { |
| 217 | switch method { |
| 218 | case MethodGet, MethodHead, MethodPost, MethodPut, MethodDelete, MethodPatch, MethodOptions: |
| 219 | return true |
| 220 | default: |
| 221 | return false |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | // New creates and returns a new Pine server. |
| 226 | func New(config ...Config) *Server { |