Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with getting raw files #1843

Open
nchursin opened this issue Dec 5, 2023 · 2 comments
Open

Issue with getting raw files #1843

nchursin opened this issue Dec 5, 2023 · 2 comments

Comments

@nchursin
Copy link

nchursin commented Dec 5, 2023

Hi

I have an issue getting a raw file from a repo. I found the source, but not sure how to fix this.

In GetRawFile there's a URL construction like this:

u := fmt.Sprintf(
      "projects/%s/repository/files/%s",
      PathEscape(project),
      PathEscape(fileName),
)

req, err := s.client.NewRequest(http.MethodGet, u, opt, options)

But NewRequest unescapes the u back to regular URL, which causes 404 in gitlab.

unescaped, err := url.PathUnescape(path)

Any ideas how to fix this, without breaking all the other stuff? :)

@nchursin
Copy link
Author

I actually found the #1675 issue, and it seems like exactly my case. I dumped the request, here's the dump:

Outgoing request:

"GET /api/v4/projects/50796694/repository/files/%2Egitlab%252Fissue_templates%252F%D1%88%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD%20%D0%B4%D0%BB%D1%8F%20%D1%81%D1%82%D0%B0%D1%82%D1%8C%D0%B8%2Emd/raw?ref=main HTTP/1.1\r\nHost: gitlab.com\r\nUser-Agent: go-gitl
ab\r\nAccept: application/json\r\nPrivate-Token: glpat-by7qqecPJJqsTM1MhGTF\r\nAccept-Encoding: gzip\r\n\r\n"
2023/12/16 23:26:52 [telegram.Router.RouteUpdate] error handling telegram update: gitlab.client.CreateArticleTask: GET https://gitlab.com/api/v4/projects/50796694/repository/files/.gitlab/issue_templates/шаблон для статьи.md/raw: 404 {message: 404 
File Not Found}

The issue seems to be somewhere in the retryablehttp, I will dig into this a bit more.

@assembly-deepali
Copy link

assembly-deepali commented Feb 2, 2024

@nchursin did you find a solution to this? hitting the same issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants