Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
450
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
aa987926
Commit
aa987926
authored
5 years ago
by
François Cartegnie
Browse files
Options
Downloads
Patches
Plain Diff
demux: adaptive: sanitize user-agent (fix
#20813
)
pretty useless since we can no longer change it...
parent
3853d029
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/demux/adaptive/http/HTTPConnection.cpp
+7
-3
7 additions, 3 deletions
modules/demux/adaptive/http/HTTPConnection.cpp
modules/demux/adaptive/http/HTTPConnection.hpp
+1
-1
1 addition, 1 deletion
modules/demux/adaptive/http/HTTPConnection.hpp
with
8 additions
and
4 deletions
modules/demux/adaptive/http/HTTPConnection.cpp
+
7
−
3
View file @
aa987926
...
...
@@ -70,7 +70,12 @@ HTTPConnection::HTTPConnection(vlc_object_t *p_object_, AuthStorage *auth,
:
AbstractConnection
(
p_object_
)
{
transport
=
socket_
;
psz_useragent
=
var_InheritString
(
p_object_
,
"http-user-agent"
);
char
*
psz_useragent
=
var_InheritString
(
p_object_
,
"http-user-agent"
);
useragent
=
psz_useragent
?
std
::
string
(
psz_useragent
)
:
std
::
string
(
""
);
free
(
psz_useragent
);
for
(
std
::
string
::
iterator
it
=
useragent
.
begin
();
it
!=
useragent
.
end
();
++
it
)
if
(
!
std
::
isprint
(
*
it
))
*
it
=
' '
;
queryOk
=
false
;
retries
=
0
;
authStorage
=
auth
;
...
...
@@ -83,7 +88,6 @@ HTTPConnection::HTTPConnection(vlc_object_t *p_object_, AuthStorage *auth,
HTTPConnection
::~
HTTPConnection
()
{
free
(
psz_useragent
);
delete
transport
;
}
...
...
@@ -435,7 +439,7 @@ std::string HTTPConnection::buildRequestHeader(const std::string &path) const
req
<<
"Cookie: "
<<
cookie
<<
"
\r\n
"
;
}
req
<<
"Cache-Control: no-cache"
<<
"
\r\n
"
<<
"User-Agent: "
<<
std
::
string
(
psz_
useragent
)
<<
"
\r\n
"
;
"User-Agent: "
<<
useragent
<<
"
\r\n
"
;
req
<<
extraRequestHeaders
();
return
req
.
str
();
}
...
...
This diff is collapsed.
Click to expand it.
modules/demux/adaptive/http/HTTPConnection.hpp
+
1
−
1
View file @
aa987926
...
...
@@ -95,7 +95,7 @@ namespace adaptive
ssize_t
readChunk
(
void
*
p_buffer
,
size_t
len
);
enum
RequestStatus
parseReply
();
std
::
string
readLine
();
char
*
psz_
useragent
;
std
::
string
useragent
;
AuthStorage
*
authStorage
;
ConnectionParams
locationparams
;
...
...
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