Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
persona
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hexang 息壤平台
persona
Commits
16fe1ff2
Commit
16fe1ff2
authored
13 years ago
by
Lloyd Hilaiel
Browse files
Options
Downloads
Patches
Plain Diff
tests for issue #878
parent
d16d54e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/post-limiting-test.js
+58
-51
58 additions, 51 deletions
tests/post-limiting-test.js
with
58 additions
and
51 deletions
tests/post-limiting-test.js
+
58
−
51
View file @
16fe1ff2
...
...
@@ -22,61 +22,68 @@ suite.options.error = false;
start_stop
.
addStartupBatches
(
suite
);
// test posting more than 10kb
suite
.
addBatch
({
"
posting more than 10kb
"
:
{
topic
:
function
(
assertion
)
{
var
cb
=
this
.
callback
;
var
req
=
http
.
request
({
host
:
'
127.0.0.1
'
,
port
:
10002
,
path
:
'
/wsapi/authenticate_user
'
,
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
},
method
:
"
POST
"
},
function
(
res
)
{
cb
(
null
,
res
);
}).
on
(
'
error
'
,
function
(
e
)
{
cb
(
e
);
});
req
.
write
(
secrets
.
weakGenerate
(
1024
*
10
+
1
));
req
.
end
();
},
"
fails
"
:
function
(
err
,
r
)
{
assert
.
ok
(
/socket hang up/
.
test
(
err
.
toString
()));
function
addTests
(
port
,
path
)
{
// test posting more than 10kb
suite
.
addBatch
({
"
posting more than 10kb
"
:
{
topic
:
function
(
assertion
)
{
var
cb
=
this
.
callback
;
var
req
=
http
.
request
({
host
:
'
127.0.0.1
'
,
port
:
port
,
path
:
path
,
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
},
method
:
"
POST
"
},
function
(
res
)
{
cb
(
null
,
res
);
}).
on
(
'
error
'
,
function
(
e
)
{
cb
(
e
);
});
req
.
write
(
secrets
.
weakGenerate
(
1024
*
10
+
1
));
req
.
end
();
},
"
fails
"
:
function
(
err
,
r
)
{
assert
.
ok
(
/socket hang up/
.
test
(
err
.
toString
()));
}
}
}
});
});
// test posting more than 10kb with content-length header
suite
.
addBatch
({
"
posting more than 10kb with content-length
"
:
{
topic
:
function
(
assertion
)
{
var
cb
=
this
.
callback
;
var
req
=
http
.
request
({
host
:
'
127.0.0.1
'
,
port
:
10002
,
path
:
'
/wsapi/authenticate_user
'
,
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
'
Content-Length
'
:
1024
*
10
+
1
},
method
:
"
POST
"
},
function
(
res
)
{
cb
(
null
,
res
);
}).
on
(
'
error
'
,
function
(
e
)
{
cb
(
e
);
});
req
.
write
(
secrets
.
weakGenerate
(
1024
*
10
+
1
));
req
.
end
();
},
"
fails
"
:
function
(
err
,
r
)
{
assert
.
strictEqual
(
413
,
r
.
statusCode
);
// test posting more than 10kb with content-length header
suite
.
addBatch
({
"
posting more than 10kb with content-length
"
:
{
topic
:
function
(
assertion
)
{
var
cb
=
this
.
callback
;
var
req
=
http
.
request
({
host
:
'
127.0.0.1
'
,
port
:
port
,
path
:
path
,
headers
:
{
'
Content-Type
'
:
'
application/x-www-form-urlencoded
'
,
'
Content-Length
'
:
1024
*
10
+
1
},
method
:
"
POST
"
},
function
(
res
)
{
cb
(
null
,
res
);
}).
on
(
'
error
'
,
function
(
e
)
{
cb
(
e
);
});
req
.
write
(
secrets
.
weakGenerate
(
1024
*
10
+
1
));
req
.
end
();
},
"
fails
"
:
function
(
err
,
r
)
{
assert
.
strictEqual
(
413
,
r
.
statusCode
);
}
}
}
}
)
;
}
);
};
// test the browserid process
addTests
(
10002
,
'
/wsapi/authenticate_user
'
);
// test the verifier
addTests
(
10000
,
'
/verify
'
);
start_stop
.
addShutdownBatches
(
suite
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment