Skip to content

Automatic format response does not work for ContentType with charset #82

Description

@xvitcoder

In case the ContentType: application/json;charset=UTF-8, i.e. it contains the charset, the automatic format of response does not work.

I think the proble is in the regex from rest.vim:668 does not substitute the charset

let fileType = substitute(contentType, '\v^.*/(.*\+)?(.*)$', '\2', 'g')

calling

substitute('application/json;charset=UTF-8', '\v^.*/(.*\+)?(.*)$', '\2', 'g')

returns json;charset=UTF-8 and not json which is the key in s:vrc_auto_format_response_patterns map.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions