mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-06-29 21:47:50 +08:00
Compare commits
3 Commits
22d7aeaec5
...
62fafb6a83
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62fafb6a83 | ||
|
|
37a4ea2a56 | ||
|
|
c011389c3f |
@ -205,6 +205,21 @@ public class SipUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Gb28181Sdp parseSDP(String sdpStr) throws SdpParseException {
|
public static Gb28181Sdp parseSDP(String sdpStr) throws SdpParseException {
|
||||||
|
|
||||||
|
// 校验:拦截空内容与注入攻击特征
|
||||||
|
if (sdpStr == null || sdpStr.trim().isEmpty()) {
|
||||||
|
throw new SdpParseException(0, 0, "SDP内容为空");
|
||||||
|
}
|
||||||
|
// 标准SDP每行格式固定为 "x=value",不存在SQL关键字;出现则视为注入攻击
|
||||||
|
String sdpUpper = sdpStr.toUpperCase();
|
||||||
|
if (sdpUpper.contains("' OR '") || sdpUpper.contains("' OR 1") || sdpUpper.contains(" OR 1=1")
|
||||||
|
|| sdpUpper.contains("--") || sdpUpper.contains("/*") || sdpUpper.contains("*/")
|
||||||
|
|| sdpUpper.contains("DROP ") || sdpUpper.contains("INSERT ") || sdpUpper.contains("UPDATE ")
|
||||||
|
|| sdpUpper.contains("DELETE ") || sdpUpper.contains("UNION ") || sdpUpper.contains("SELECT ")) {
|
||||||
|
log.error("[SDP注入攻击] 检测到非法SDP内容,已拒绝解析,内容长度: {}", sdpStr.length());
|
||||||
|
throw new SdpParseException(0, 0, "非法SDP内容");
|
||||||
|
}
|
||||||
|
//校验结束
|
||||||
|
|
||||||
// jainSip不支持y= f=字段, 移除以解析。
|
// jainSip不支持y= f=字段, 移除以解析。
|
||||||
int ssrcIndex = sdpStr.indexOf("y=");
|
int ssrcIndex = sdpStr.indexOf("y=");
|
||||||
|
|||||||
@ -54,10 +54,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const paramUrl = decodeURIComponent(this.$route.params.url)
|
if (this.$route.params.url) {
|
||||||
console.log(paramUrl)
|
const paramUrl = decodeURIComponent(this.$route.params.url)
|
||||||
if (!this.videoUrl && paramUrl) {
|
console.log(paramUrl)
|
||||||
this.videoUrl = paramUrl
|
if (!this.videoUrl) {
|
||||||
|
this.videoUrl = paramUrl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.btnDom = document.getElementById('buttonsBox')
|
this.btnDom = document.getElementById('buttonsBox')
|
||||||
},
|
},
|
||||||
@ -217,6 +219,10 @@ export default {
|
|||||||
this.play(this.videoUrl)
|
this.play(this.videoUrl)
|
||||||
},
|
},
|
||||||
play: function(url) {
|
play: function(url) {
|
||||||
|
if (!url) {
|
||||||
|
console.warn('Jessibuca -> invalid url, skip play')
|
||||||
|
return
|
||||||
|
}
|
||||||
this.videoUrl = url
|
this.videoUrl = url
|
||||||
console.log('Jessibuca -> url: ', url)
|
console.log('Jessibuca -> url: ', url)
|
||||||
if (!jessibucaPlayer[this._uid]) {
|
if (!jessibucaPlayer[this._uid]) {
|
||||||
|
|||||||
@ -44,6 +44,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMediaInfo: function() {
|
getMediaInfo: function() {
|
||||||
|
if (!this.app || !this.stream || !this.mediaServerId) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$store.dispatch('server/getMediaInfo', {
|
this.$store.dispatch('server/getMediaInfo', {
|
||||||
app: this.app,
|
app: this.app,
|
||||||
stream: this.stream,
|
stream: this.stream,
|
||||||
@ -52,6 +55,7 @@ export default {
|
|||||||
.then(data => {
|
.then(data => {
|
||||||
this.info = data
|
this.info = data
|
||||||
})
|
})
|
||||||
|
.catch(() => {})
|
||||||
},
|
},
|
||||||
startTask: function() {
|
startTask: function() {
|
||||||
this.task = setInterval(this.getMediaInfo, 1000)
|
this.task = setInterval(this.getMediaInfo, 1000)
|
||||||
|
|||||||
@ -473,10 +473,13 @@ export default {
|
|||||||
this.mediaServerId = streamInfo.mediaServerId
|
this.mediaServerId = streamInfo.mediaServerId
|
||||||
this.playFromStreamInfo(false, streamInfo)
|
this.playFromStreamInfo(false, streamInfo)
|
||||||
},
|
},
|
||||||
getUrlByStreamInfo() {
|
getUrlByStreamInfo(streamInfo) {
|
||||||
let streamInfo = this.streamInfo
|
streamInfo = streamInfo || this.streamInfo
|
||||||
if (this.streamInfo.transcodeStream) {
|
if (!streamInfo) {
|
||||||
streamInfo = this.streamInfo.transcodeStream
|
return ''
|
||||||
|
}
|
||||||
|
if (streamInfo.transcodeStream) {
|
||||||
|
streamInfo = streamInfo.transcodeStream
|
||||||
}
|
}
|
||||||
let videoUrl
|
let videoUrl
|
||||||
if (location.protocol === 'https:') {
|
if (location.protocol === 'https:') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user