Skip to content
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

Handle redirects correctly #150

Open
squnit opened this issue Apr 8, 2021 · 3 comments
Open

Handle redirects correctly #150

squnit opened this issue Apr 8, 2021 · 3 comments

Comments

@squnit
Copy link
Contributor

squnit commented Apr 8, 2021

When an instructor uploads a .html file, an HTML file redirecting to https://${canvas_domain}/api/v1/courses/${course_id}/module_item_redirect/${file_id} will be put under modules in place of the actual file. This results in the actual content not being downloaded, but you end up with the file (${var} are redacted variables)

<html>
<head>
    <title>${file_title}</title>
    <meta charset="UTF-8" />
    <meta http-equiv="refresh" content="0; URL=https://${canvas_domain}/api/v1/courses/${course_id}/module_item_redirect/${file_id}" />
</head>
<body>
    <p>Redirecting you to <a href="https://${canvas_domain}/api/v1/courses/${course_id}/module_item_redirect/${file_id}">${file_name}</a></p>
</body>
</html>
@skyzh
Copy link
Owner

skyzh commented Apr 8, 2021

Seems to be a very rare case, and I don't have an environment which could reproduce this... If you are interested in this, you may help fix.

@s-crypt
Copy link

s-crypt commented Dec 8, 2021

I have this issue as well. For general pages with text, rather than download the content of the page, the downloaded html is close to what @squnit has pasted.
Essentially some pages are not downloaded, just redirect files.

<html>
<head>
    <title>Assignment 1</title>
    <meta charset="UTF-8" />
    <meta http-equiv="refresh" content="0; URL=https://{canvas.example.com}/courses/{course}/modules/items/{assignment}" />
</head>
<body>
    <p>Redirecting you to <a href="https://{canvas.example.com}/courses/{course}/modules/items/{assignment}">Assignment 1</a></p>
</body>
</html>

@NoahCardoza
Copy link

I'm getting this too. I wonder if it has to do with courses that are private vs public? I only have private courses so I have nothing to compare to. I was about to create a project similar to this for myself but since I've found this I might be able to look into this.

Bear with me as it might take a while for time to free up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants