Skip to content

Import error: title is not fully printable #630

Closed

Description

@rng-dynamics

I am importing all the the issues from https://github.com/golang/go. (Currently I am using git-bug from PR #585).

I get the following error:

import error: issue creation: title is not fully printable

Here is the issue which causes that: golang/go#43562.
The JSON from the GraphQL API looks as follows:

"issue": {
        "title": "src/net/http/header when header have\u0002 ",
        "body": "<!--\r\nPlease answer these questions before submitting your issue. Thanks!\r\nFor questions please use one of our forums: https://github.com/golang/go/wiki/Questions\r\n-->\r\n\r\n### What version of Go are you using (`go version`)?\r\n\r\n<pre>\r\n$ go version\r\ngo version go1.15.2 linux/amd64\r\n</pre>\r\n\r\nwhen i post header like (202012300001\u0002sometext\u0002timestampvalue)  to go http server   \r\ni got error  400 bad request  invalid header value  \r\n\r\n\r\n"
}

Activity

  1. MichaelMure commented on Apr 10, 2021

    @MichaelMure
    Contributor

    So what's happening is that the core of git-bug is checking that there is no funny characters in the bugs (here it's a control character). This is checked with the function text.Safe().

    There is the counterpart function text.Cleanup() that should be used on every imported text by the bridges. In the github bridge, this is done for the content of the issue, but not the title.

  2. MichaelMure commented on Apr 15, 2021

    @MichaelMure
    Contributor

    On that topic, I found that text.Cleanup() can't return an error with how the current code is written, so this could be made way cleaner.

  3. added a commit that references this issue on Apr 17, 2021
    51a2c85
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions