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

🐛 Bug Report: Prompt ChatGPT Python Template not rendering page #220

Closed
2 tasks done
codewithkushagra opened this issue Oct 5, 2023 · 4 comments
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@codewithkushagra
Copy link
Contributor

codewithkushagra commented Oct 5, 2023

👟 Reproduction steps

  • Deploy an instance of Prompt ChatGPT template using appwrite function.
  • Follow the deployment link and you will find that HTML page is not being rendered

Reason for issue

  • The Content-Type received is text/plain
  • Where as for rendering HTML content it should have been text/html
Screenshot 2023-10-06 at 2 48 56 AM

Suggested Solution

Here in the current code context is parsing content-type as Content-Type which is causing this issue

if context.req.method == "GET":
        return context.res.send(
            get_static_file("index.html"),
            200,
            {
                "Content-Type": "text/html; charset=utf-8"
            }
        )

To correct this we can change the Content-Type to content-type in the code that is

if context.req.method == "GET":
        return context.res.send(
            get_static_file("index.html"),
            200,
            {
                "content-type": "text/html; charset=utf-8"
            }
        )

👍 Expected behavior

The expected behavior should have been the rendered HTML page like

Screenshot 2023-10-06 at 2 57 40 AM

👎 Actual Behavior

But the actual current behavior is showing unrendered raw HTML

Screenshot 2023-10-06 at 2 58 53 AM

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

MacOS

🧱 Your Environment

Appwrite version 1.4.4, I haven't customized it any ways

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@codewithkushagra codewithkushagra added the bug Something isn't working label Oct 5, 2023
@codewithkushagra
Copy link
Contributor Author

@Haimantika I have found this issue while setting up and testing the platform can you please assign me this issue, so that I can raise a PR for it.

@loks0n
Copy link
Member

loks0n commented Oct 6, 2023

Hey @codewithkushagra,
I've assigned you to the issue.
Feel free to open a PR for it

@codewithkushagra
Copy link
Contributor Author

okay, Thank you @loks0n I will create a PR for this

@codewithkushagra
Copy link
Contributor Author

codewithkushagra commented Oct 6, 2023

@loks0n I have made the PR here: #224
Can you please review it, and if it looks good to you can merge it. If there are any changes required please let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants