Commit Graph

5 Commits

Author SHA1 Message Date
~lucidiot d84955e6cd Fix URL building for default repo branch API
Using the base URL in path.Join caused it to remove the two slashes (because /////tmp == /tmp):

`https:/tildegit.org/api/v1/repos/owner/name`

Then, using that in URL.Parse causes it to see a `https:` scheme, and the / right afterwards means "start a path here", not a hostname, because hostnames begin with two slashes. That's a valid URL, with no hostname. Then it gets turned back into a string:

`https:///tildegit.org/api/v1/repos/owner/name`

That's another way of expressing the same URL with no hostname: //<empty hostname>/<path>.

curl, Firefox and Chromium all fix the triple slash automatically, but fasthttp doesn't, and it tries to look up the empty string as a DNS host!
2022-07-20 16:21:35 +00:00
Ben Harris 1955acce05 parse url correctly? 2022-05-26 15:23:27 -04:00
Ben Harris 54946a45d7 gitea api logging 2022-05-26 13:57:36 -04:00
Ben Harris 3e04412113 add some more logging so i can see where stuff is failing 2022-05-26 11:33:17 -04:00
6543 4267d54a63 refactor (2) (#34)
move forward with refactoring:
 - initial implementation of a smal "gitea client for fasthttp"
 - move constant into const.go

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/34
Reviewed-by: Otto Richter <otto@codeberg.org>
2022-04-20 23:42:01 +02:00