[GH-ISSUE #5294] [bug]: raw body of "text/plain" mime type is mapped to "text/x-yaml" codemirror mode #2022

Closed
opened 2026-03-16 22:53:25 +03:00 by kerem · 1 comment
Owner

Originally created by @lchansf on GitHub (Jul 29, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5294

Originally assigned to: @anwarulislam on GitHub.

Is there an existing issue for this?

  • I have searched existing issues and this bug hasn't been reported yet

Platform

Web App

Browser

Chrome

Operating System

macOS

Bug Description

If I set the content-type of a request body to "text/plain" and paste a long text with little space (in my case it contains a long base64-encoded string that's over 1 Mb), the hoppscotch UI will become unresponsive. It takes 2-3 minutes for it to become responsive again.

The problem seems to be that RawBody.vue calls getEditorLangForMimeType in editorutils.ts to map the content-type to CodeMirror mode. "text/plain" and anything not in the map is mapped to "text/x-yaml":

const mimeToMode = {
  "text/plain": "text/x-yaml",
  "text/html": "htmlmixed",
  "application/xml": "application/xml",
  "application/hal+json": "application/ld+json",
  "application/vnd.api+json": "application/ld+json",
  "application/json": "application/ld+json",
}

export function getEditorLangForMimeType(mimeType: string): string {
  return mimeToMode[mimeType] || "text/x-yaml"
}

The yaml parser in CodeMirror takes a long time to finish parsing such long text when it's not really in yaml format. It doesn't seem Hoppscotch should use "text/x-yaml" as the default, especially when the content-type is already specified as "text/plain".

This is reproducible in both web app and desktop app, but it takes longer for web app to become responsive again.

Deployment Type

Self-hosted (on-prem deployment)

Version

25.4.5 (20250630.202218)

Originally created by @lchansf on GitHub (Jul 29, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5294 Originally assigned to: @anwarulislam on GitHub. ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Platform Web App ### Browser Chrome ### Operating System macOS ### Bug Description If I set the content-type of a request body to "text/plain" and paste a long text with little space (in my case it contains a long base64-encoded string that's over 1 Mb), the hoppscotch UI will become unresponsive. It takes 2-3 minutes for it to become responsive again. The problem seems to be that RawBody.vue calls getEditorLangForMimeType in editorutils.ts to map the content-type to CodeMirror mode. "text/plain" and anything not in the map is mapped to "text/x-yaml": ``` const mimeToMode = { "text/plain": "text/x-yaml", "text/html": "htmlmixed", "application/xml": "application/xml", "application/hal+json": "application/ld+json", "application/vnd.api+json": "application/ld+json", "application/json": "application/ld+json", } export function getEditorLangForMimeType(mimeType: string): string { return mimeToMode[mimeType] || "text/x-yaml" } ``` The yaml parser in CodeMirror takes a long time to finish parsing such long text when it's not really in yaml format. It doesn't seem Hoppscotch should use "text/x-yaml" as the default, especially when the content-type is already specified as "text/plain". This is reproducible in both web app and desktop app, but it takes longer for web app to become responsive again. ### Deployment Type Self-hosted (on-prem deployment) ### Version 25.4.5 (20250630.202218)
kerem 2026-03-16 22:53:25 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@jamesgeorge007 commented on GitHub (Dec 5, 2025):

Closing since this is addressed in the v2025.11.1 release.

<!-- gh-comment-id:3616087564 --> @jamesgeorge007 commented on GitHub (Dec 5, 2025): Closing since this is addressed in the [v2025.11.1 release](https://github.com/hoppscotch/hoppscotch/releases/tag/2025.11.1).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#2022
No description provided.