-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Endpoint route in Servlet-3.0 Framework
- Loading branch information
1 parent
0576b23
commit b823e8d
Showing
5 changed files
with
36 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...rumentation-security/servlet-3.0/src/main/java/javax/servlet/Servlet_Instrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package javax.servlet; | ||
|
||
import com.newrelic.agent.security.instrumentation.servlet30.HttpServletHelper; | ||
import com.newrelic.api.agent.security.NewRelicSecurity; | ||
import com.newrelic.api.agent.security.schema.SecurityMetaData; | ||
import com.newrelic.api.agent.weaver.MatchType; | ||
import com.newrelic.api.agent.weaver.Weave; | ||
import com.newrelic.api.agent.weaver.Weaver; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
|
||
@Weave(type = MatchType.Interface, originalName = "javax.servlet.Servlet") | ||
public class Servlet_Instrumentation { | ||
public void service(ServletRequest req, ServletResponse res){ | ||
if (NewRelicSecurity.isHookProcessingActive() && req instanceof HttpServletRequest){ | ||
SecurityMetaData metaData = NewRelicSecurity.getAgent().getSecurityMetaData(); | ||
HttpServletHelper.setRoute((HttpServletRequest) req, metaData.getRequest(), metaData.getMetaData()); | ||
} | ||
Weaver.callOriginal(); | ||
} | ||
} |