Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
7f1fcc8b
...
7f1fcc8bb811abe9c049ac7b495e91cf3d1af4e1
authored
2012-10-27 10:19:14 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
clean urls in self test server uri handling
1 parent
661944c9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
tests/selftest.js
tests/selftest.js
View file @
7f1fcc8
...
...
@@ -18,9 +18,14 @@ function info(message) {
service
=
server
.
listen
(
testServerPort
,
function
(
request
,
response
)
{
"use strict"
;
var
pageFile
=
fs
.
pathJoin
(
phantom
.
casperPath
,
request
.
url
);
var
requestPath
=
request
.
url
;
if
(
requestPath
.
indexOf
(
'?'
)
!==
-
1
)
{
requestPath
=
request
.
url
.
split
(
'?'
)[
0
];
}
var
pageFile
=
fs
.
pathJoin
(
phantom
.
casperPath
,
requestPath
);
if
(
!
fs
.
exists
(
pageFile
)
||
!
fs
.
isFile
(
pageFile
))
{
response
.
statusCode
=
404
;
console
.
log
(
utils
.
format
(
'Test server url not found: %s (file: %s)'
,
request
.
url
,
pageFile
),
"warning"
);
response
.
write
(
"404 - NOT FOUND"
);
}
else
{
response
.
statusCode
=
200
;
...
...
Please
register
or
sign in
to post a comment