mirror of
https://github.com/miniflux/v2.git
synced 2025-08-31 18:31:01 +00:00
test(rewrite): fix flaky test case by sorting query string keys
This commit is contained in:
parent
e8e3a600b4
commit
0f3c04a98a
2 changed files with 10 additions and 11 deletions
|
@ -331,20 +331,19 @@ func addInvidiousVideo(entryURL, entryContent string) string {
|
|||
return entryContent
|
||||
}
|
||||
|
||||
v := u.Query().Get("v")
|
||||
if v == "" {
|
||||
qs := u.Query()
|
||||
videoID := qs.Get("v")
|
||||
if videoID == "" {
|
||||
return entryContent
|
||||
}
|
||||
qs.Del("v")
|
||||
|
||||
src := "https://" + u.Hostname() + `/embed/` + v
|
||||
for key, val := range u.Query() {
|
||||
if key == "v" || len(val) != 1 {
|
||||
continue
|
||||
}
|
||||
src += "&" + key + "=" + val[0]
|
||||
embedVideoURL := "https://" + u.Hostname() + `/embed/` + videoID
|
||||
if len(qs) > 0 {
|
||||
embedVideoURL += "?" + qs.Encode()
|
||||
}
|
||||
|
||||
return addVideoPlayerIframe(src, entryContent)
|
||||
return addVideoPlayerIframe(embedVideoURL, entryContent)
|
||||
}
|
||||
|
||||
func addPDFLink(entryURL, entryContent string) string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue