1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | 'use strict';
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | var http = require('http');
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | module.exports = getCurrentNodeMethods() || getBasicNodeMethods();
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | function getCurrentNodeMethods() {
|
30 | return http.METHODS && http.METHODS.map(function lowerCaseMethod(method) {
|
31 | return method.toLowerCase();
|
32 | });
|
33 | }
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | function getBasicNodeMethods() {
|
41 | return [
|
42 | 'get',
|
43 | 'post',
|
44 | 'put',
|
45 | 'head',
|
46 | 'delete',
|
47 | 'options',
|
48 | 'trace',
|
49 | 'copy',
|
50 | 'lock',
|
51 | 'mkcol',
|
52 | 'move',
|
53 | 'purge',
|
54 | 'propfind',
|
55 | 'proppatch',
|
56 | 'unlock',
|
57 | 'report',
|
58 | 'mkactivity',
|
59 | 'checkout',
|
60 | 'merge',
|
61 | 'm-search',
|
62 | 'notify',
|
63 | 'subscribe',
|
64 | 'unsubscribe',
|
65 | 'patch',
|
66 | 'search',
|
67 | 'connect'
|
68 | ];
|
69 | }
|