move to micro v4 #154
							
								
								
									
										15
									
								
								http.go
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								http.go
									
									
									
									
									
								
							@@ -184,14 +184,17 @@ func (h *httpServer) NewHandler(handler interface{}, opts ...server.HandlerOptio
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	tp := reflect.TypeOf(handler)
 | 
						tp := reflect.TypeOf(handler)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if len(options.Metadata) == 0 {
 | 
						/*
 | 
				
			||||||
		if h.registerRPC {
 | 
							if len(options.Metadata) == 0 {
 | 
				
			||||||
			h.opts.Logger.Infof(h.opts.Context, "register rpc handler for http.MethodPost %s /%s", hn, hn)
 | 
								if h.registerRPC {
 | 
				
			||||||
			if err := hdlr.handlers.Insert([]string{http.MethodPost}, "/"+hn, pth); err != nil {
 | 
									h.opts.Logger.Infof(h.opts.Context, "register rpc handler for http.MethodPost %s /%s", hn, hn)
 | 
				
			||||||
				h.opts.Logger.Errorf(h.opts.Context, "cant add rpc handler for http.MethodPost %s /%s", hn, hn)
 | 
									if err := hdlr.handlers.Insert([]string{http.MethodPost}, "/"+hn, pth); err != nil {
 | 
				
			||||||
 | 
										h.opts.Logger.Errorf(h.opts.Context, "cant add rpc handler for http.MethodPost %s /%s", hn, hn)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for hn, md := range options.Metadata {
 | 
						for hn, md := range options.Metadata {
 | 
				
			||||||
		var method reflect.Method
 | 
							var method reflect.Method
 | 
				
			||||||
		mname := hn[strings.Index(hn, ".")+1:]
 | 
							mname := hn[strings.Index(hn, ".")+1:]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user