appwrite / templates

Templates for Appwrite Functions ⚡️🌩️
https://appwrite.io
MIT License
105 stars 81 forks source link

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

Closed codewithkushagra closed 8 months ago

codewithkushagra commented 9 months ago

👟 Reproduction steps

Reason for issue

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?

🏢 Have you read the Code of Conduct?

codewithkushagra commented 9 months ago

@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 commented 9 months ago

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

codewithkushagra commented 9 months ago

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

codewithkushagra commented 9 months ago

@loks0n I have made the PR here: https://github.com/appwrite/templates/pull/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