Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
node-http-proxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
node-http-proxy
Commits
c03a450d
Commit
c03a450d
authored
Oct 15, 2011
by
Max Ogden
Committed by
Charlie McConnell
Nov 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify proxytable path segment rewrite logic
parent
2061c713
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
lib/node-http-proxy/proxy-table.js
lib/node-http-proxy/proxy-table.js
+5
-7
No files found.
lib/node-http-proxy/proxy-table.js
View file @
c03a450d
...
...
@@ -138,14 +138,12 @@ ProxyTable.prototype.getProxyLocation = function (req) {
var
route
=
this
.
routes
[
i
];
if
(
target
.
match
(
route
.
route
))
{
var
s
egments
=
route
.
path
.
split
(
'
/
'
);
var
pathS
egments
=
route
.
path
.
split
(
'
/
'
);
if
(
segments
.
length
>
0
)
{
var
lastSegment
=
new
RegExp
(
"
/
"
+
segments
[
segments
.
length
-
1
]
+
"
$
"
);
if
(
req
.
url
.
match
(
lastSegment
))
{
req
.
url
=
req
.
url
.
replace
(
lastSegment
,
'
/
'
);
}
if
(
pathSegments
.
length
>
0
)
{
// don't include the proxytable path segments in the proxied request url
pathSegments
=
new
RegExp
(
"
/
"
+
pathSegments
.
slice
(
1
).
join
(
'
/
'
));
req
.
url
=
req
.
url
.
replace
(
pathSegments
,
''
);
}
var
location
=
route
.
target
.
split
(
'
:
'
),
...
...
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