make-fetch 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -29,7 +29,8 @@ export function makeRoutedFetch ({
|
|
|
29
29
|
return onNotFound(request)
|
|
30
30
|
}
|
|
31
31
|
try {
|
|
32
|
-
|
|
32
|
+
const response = await route.handler(request)
|
|
33
|
+
return response
|
|
33
34
|
} catch (e) {
|
|
34
35
|
return await onError(e, request)
|
|
35
36
|
}
|
|
@@ -149,6 +150,8 @@ function matches (request, route, property) {
|
|
|
149
150
|
return areEqual(route.hostname, new URL(request.url).hostname)
|
|
150
151
|
} else if (property === 'protocol') {
|
|
151
152
|
return areEqual(route.protocol, new URL(request.url).protocol)
|
|
153
|
+
} else if(property === 'method') {
|
|
154
|
+
return areEqual(route.method, request.method.toUpperCase())
|
|
152
155
|
} else {
|
|
153
156
|
const routeProperty = route[property]
|
|
154
157
|
const requestProperty = request[property]
|