Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
1ef4e349
Commit
1ef4e349
authored
Sep 07, 2015
by
justcoding121
Committed by
justcoding121
Sep 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix read me
parent
17ffb97c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
README.md
README.md
+2
-3
No files found.
README.md
View file @
1ef4e349
...
@@ -52,8 +52,7 @@ Sample request and response event handlers
...
@@ -52,8 +52,7 @@ Sample request and response event handlers
```
csharp
```
csharp
//Test On Request, intecept requests
//Test On Request, intercept requests
//Read browser URL send back to proxy by the injection script in OnResponse event
public
void
OnRequest
(
object
sender
,
SessionEventArgs
e
)
public
void
OnRequest
(
object
sender
,
SessionEventArgs
e
)
{
{
...
@@ -102,7 +101,7 @@ Sample request and response event handlers
...
@@ -102,7 +101,7 @@ Sample request and response event handlers
//Get response body as string
//Get response body as string
string
responseBody
=
e
.
GetResponseBodyAsString
();
string
responseBody
=
e
.
GetResponseBodyAsString
();
//
Modify e.ServerResponse
//
Inject script in to body
Regex
rex
=
new
Regex
(
"</body>"
,
RegexOptions
.
RightToLeft
|
RegexOptions
.
IgnoreCase
|
RegexOptions
.
Multiline
);
Regex
rex
=
new
Regex
(
"</body>"
,
RegexOptions
.
RightToLeft
|
RegexOptions
.
IgnoreCase
|
RegexOptions
.
Multiline
);
string
modified
=
rex
.
Replace
(
responseBody
,
"<script type =\"text/javascript\">alert('Response was modified by this script!');</script></body>"
,
1
);
string
modified
=
rex
.
Replace
(
responseBody
,
"<script type =\"text/javascript\">alert('Response was modified by this script!');</script></body>"
,
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment