Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Windows
pEp for Outlook
Commits
adec6d7b
Commit
adec6d7b
authored
Sep 20, 2021
by
Thomas
Browse files
Return error status if invalid request is received.
parent
3545f8c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
DPE/DPEWebServer.cs
View file @
adec6d7b
...
@@ -28,14 +28,15 @@ namespace pEp.DPE
...
@@ -28,14 +28,15 @@ namespace pEp.DPE
if
(
context
.
Request
.
HttpMethod
!=
"POST"
)
if
(
context
.
Request
.
HttpMethod
!=
"POST"
)
{
{
Log
.
Warning
(
"Process request: Ignoring request of type "
+
context
.
Request
.
HttpMethod
);
Log
.
Warning
(
"Process request: Ignoring request of type "
+
context
.
Request
.
HttpMethod
);
return
;
}
}
string
request
=
null
;
string
request
=
null
;
try
try
{
{
using
(
var
stream
=
context
.
Request
.
InputStream
)
using
(
Stream
stream
=
context
.
Request
.
InputStream
)
using
(
va
r
sr
=
new
StreamReader
(
stream
))
using
(
StreamReade
r
sr
=
new
StreamReader
(
stream
))
{
{
request
=
sr
.
ReadToEnd
();
request
=
sr
.
ReadToEnd
();
}
}
...
@@ -43,6 +44,8 @@ namespace pEp.DPE
...
@@ -43,6 +44,8 @@ namespace pEp.DPE
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
Log
.
Error
(
"ProcessRequest: Error getting request. "
+
ex
.
ToString
());
Log
.
Error
(
"ProcessRequest: Error getting request. "
+
ex
.
ToString
());
context
.
Response
.
StatusCode
=
(
int
)
HttpStatusCode
.
BadRequest
;
context
.
Response
.
Close
();
return
;
return
;
}
}
...
...
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