mirror of
				https://github.com/linka-cloud/grpc.git
				synced 2025-10-31 01:22:29 +00:00 
			
		
		
		
	react: export REACT_ENDPOINT env var, recovery interceptor: remove panicing client handlers
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
		| @@ -22,11 +22,3 @@ func (i *recovery) UnaryServerInterceptor() grpc.UnaryServerInterceptor { | |||||||
| func (i *recovery) StreamServerInterceptor() grpc.StreamServerInterceptor { | func (i *recovery) StreamServerInterceptor() grpc.StreamServerInterceptor { | ||||||
| 	return grpc_recovery.StreamServerInterceptor(i.opts...) | 	return grpc_recovery.StreamServerInterceptor(i.opts...) | ||||||
| } | } | ||||||
|  |  | ||||||
| func (i *recovery) UnaryClientInterceptor() grpc.UnaryClientInterceptor { |  | ||||||
| 	panic("not implemented") |  | ||||||
| } |  | ||||||
|  |  | ||||||
| func (i *recovery) StreamClientInterceptor() grpc.StreamClientInterceptor { |  | ||||||
| 	panic("not implemented") |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -24,8 +24,12 @@ import ( | |||||||
| 	"strings" | 	"strings" | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  | const ( | ||||||
|  | 	EndpointEnv = "REACT_ENDPOINT" | ||||||
|  | ) | ||||||
|  |  | ||||||
| func NewHandler(dir embed.FS, subpath string) (http.Handler, error) { | func NewHandler(dir embed.FS, subpath string) (http.Handler, error) { | ||||||
| 	if e := os.Getenv("REACT_ENDPOINT"); e != "" { | 	if e := os.Getenv(EndpointEnv); e != "" { | ||||||
| 		return newProxy(e) | 		return newProxy(e) | ||||||
| 	} | 	} | ||||||
| 	return newStatic(dir, subpath) | 	return newStatic(dir, subpath) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user