Skip to content

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

@codewithkushagra

Description

@codewithkushagra

👟 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?

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions