-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request from GHSA-gv9r-qcjc-5hj7
* Filter JSONP callback function name. v5.0.210,v6.0.121 * Add utest. * Refine utest
- Loading branch information
Showing
7 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,6 @@ | |
|
||
#define VERSION_MAJOR 5 | ||
#define VERSION_MINOR 0 | ||
#define VERSION_REVISION 209 | ||
#define VERSION_REVISION 210 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// Copyright (c) 2013-2024 The SRS Authors | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
#include <srs_utest_protocol3.hpp> | ||
|
||
using namespace std; | ||
|
||
#include <srs_kernel_error.hpp> | ||
#include <srs_core_autofree.hpp> | ||
#include <srs_protocol_utility.hpp> | ||
#include <srs_protocol_rtmp_msg_array.hpp> | ||
#include <srs_protocol_rtmp_stack.hpp> | ||
#include <srs_kernel_utility.hpp> | ||
#include <srs_app_st.hpp> | ||
#include <srs_protocol_amf0.hpp> | ||
#include <srs_protocol_rtmp_stack.hpp> | ||
#include <srs_protocol_http_conn.hpp> | ||
#include <srs_protocol_protobuf.hpp> | ||
#include <srs_kernel_buffer.hpp> | ||
|
||
extern bool srs_is_valid_jsonp_callback(std::string callback); | ||
|
||
VOID TEST(ProtocolHttpTest, JsonpCallbackName) | ||
{ | ||
EXPECT_TRUE(srs_is_valid_jsonp_callback("")); | ||
EXPECT_TRUE(srs_is_valid_jsonp_callback("callback")); | ||
EXPECT_TRUE(srs_is_valid_jsonp_callback("Callback")); | ||
EXPECT_TRUE(srs_is_valid_jsonp_callback("Callback1234567890")); | ||
EXPECT_TRUE(srs_is_valid_jsonp_callback("Callback-1234567890")); | ||
EXPECT_TRUE(srs_is_valid_jsonp_callback("Callback_1234567890")); | ||
EXPECT_TRUE(srs_is_valid_jsonp_callback("Callback.1234567890")); | ||
EXPECT_TRUE(srs_is_valid_jsonp_callback("Callback1234567890-_.")); | ||
EXPECT_FALSE(srs_is_valid_jsonp_callback("callback()//")); | ||
EXPECT_FALSE(srs_is_valid_jsonp_callback("callback!")); | ||
EXPECT_FALSE(srs_is_valid_jsonp_callback("callback;")); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// Copyright (c) 2013-2024 The SRS Authors | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
|
||
#ifndef SRS_UTEST_PROTOCOL3_HPP | ||
#define SRS_UTEST_PROTOCOL3_HPP | ||
|
||
/* | ||
#include <srs_utest_protocol3.hpp> | ||
*/ | ||
#include <srs_utest_protocol.hpp> | ||
|
||
#endif | ||
|