-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set canonical link to original video/playlist url #3406
Set canonical link to original video/playlist url #3406
Conversation
The local URL was used instead of the original url Signed-off-by: Thomas Citharel <[email protected]>
Signed-off-by: Thomas Citharel <[email protected]>
@@ -47,8 +51,19 @@ describe('Test a client controllers', function () { | |||
before(async function () { | |||
this.timeout(120000) | |||
|
|||
server = await flushAndRunServer(1) | |||
server.accessToken = await serverLogin(server) | |||
servers = await flushAndRunMultipleServers(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A fancy way would be [server, secondServer] = await flushAndRunMultipleServers(2)
server/tests/client.ts
Outdated
await setAccessTokensToServers(servers) | ||
|
||
{ | ||
const res = await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to upload a video here? According to line 78 there's already a video on the server.
If we need this line, then line 78 has to be updated (that's why tests are failing).
server/tests/client.ts
Outdated
|
||
it('Should use the original video URL for the canonical tag', async function () { | ||
const res = await makeHTMLRequest(servers[1].url, '/videos/watch/' + videoUUID) | ||
expect(res.text).to.contain(`<link rel="canonical" href="${videoOriginalUrl}" />`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By using server.video
we could change the test to:
const res = await makeHTMLRequest(servers[1].url, '/videos/watch/' + server.video.uuid)
expect(res.text).to.contain(`<link rel="canonical" href="${server.video.url}" />`)
Thanks @tcitworld @kontrollanten |
The local URL was used instead of the original url
Description
The local URL was used instead of the original url
Related issues
Previously fixed in #1539
Added a test to check but didn't manage to run them, so they're all yours.