Merge pull request #259 from stevvooe/validate-var-prefixes
context: validate prefix lookups for WithRequest/WithResponse contextsmaster
						commit
						40ec1222a9
					
				| 
						 | 
					@ -133,6 +133,10 @@ func (ctx *httpRequestContext) Value(key interface{}) interface{} {
 | 
				
			||||||
			return ctx.r
 | 
								return ctx.r
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if !strings.HasPrefix(keyStr, "http.request.") {
 | 
				
			||||||
 | 
								goto fallback
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		parts := strings.Split(keyStr, ".")
 | 
							parts := strings.Split(keyStr, ".")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if len(parts) != 3 {
 | 
							if len(parts) != 3 {
 | 
				
			||||||
| 
						 | 
					@ -241,6 +245,10 @@ func (irw *instrumentedResponseWriter) Value(key interface{}) interface{} {
 | 
				
			||||||
			return irw.ResponseWriter
 | 
								return irw.ResponseWriter
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if !strings.HasPrefix(keyStr, "http.response.") {
 | 
				
			||||||
 | 
								goto fallback
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		parts := strings.Split(keyStr, ".")
 | 
							parts := strings.Split(keyStr, ".")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if len(parts) != 3 {
 | 
							if len(parts) != 3 {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue