This is an automated email from the ASF dual-hosted git repository.

min pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-ops.git


The following commit(s) were added to refs/heads/develop by this push:
     new 4042f39  Only accept the GET method (#165)
4042f39 is described below

commit 4042f39aaa6b28bd3b6e447178046f38e60e9dc9
Author: 马金凯 <[email protected]>
AuthorDate: Fri Oct 26 16:10:28 2018 +0800

    Only accept the GET method (#165)
---
 .../java/org/apache/dubbo/admin/controller/ServiceController.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/controller/ServiceController.java
 
b/dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/controller/ServiceController.java
index 708f1bb..66917dc 100644
--- 
a/dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/controller/ServiceController.java
+++ 
b/dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/controller/ServiceController.java
@@ -45,7 +45,7 @@ public class ServiceController {
 
     @RequestMapping(method = RequestMethod.GET)
     public List<ServiceDTO> searchService(@RequestParam String pattern,
-                                   @RequestParam(required = false) String 
filter) {
+                                          @RequestParam(required = false) 
String filter) {
 
         List<Provider> allProviders = providerService.findAll();
 
@@ -73,7 +73,7 @@ public class ServiceController {
                         key = provider.getService().toLowerCase();
                         break;
                 }
-                if (key.contains(filter)) {
+                if (key != null && key.contains(filter)) {
                     result.add(createService(provider, map));
                 }
             }
@@ -81,7 +81,7 @@ public class ServiceController {
         return result;
     }
 
-    @RequestMapping("/{service}")
+    @RequestMapping(value = "/{service}", method = RequestMethod.GET)
     public ServiceDetailDTO serviceDetail(@PathVariable String service) {
         List<Provider> providers = providerService.findByService(service);
 

Reply via email to