mirror of
1
Fork 0
forgejo/web_src/js
Giteabot 628e1036cf
Fix gitea-origin-url with default ports (#29085) (#29088)
Backport #29085 by @silverwind

When setting `url.host` on a URL object with no port specified (like is
the case of default port), the resulting URL's port will not change.
Workaround this quirk in the URL standard by explicitely setting port
for the http and https protocols.

Extracted the logic to a function for the purpose of testing. Initially
I wanted to have the function in utils.js, but it turns out esbuild can
not treeshake the unused functions which would result in the
webcomponents chunk having all 2kB utils.js inlined, so it seemed not
worth.

Fixes: https://github.com/go-gitea/gitea/issues/29084

Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit fb7f28e9a7ee441e85dc957ac507278650af2f63)
2024-02-13 14:17:58 +01:00
..
components Modernize merge button (#28140) (#28786) 2024-01-16 14:40:18 +00:00
features Preserve BOM in web editor (#28935) (#28959) 2024-01-31 14:18:26 +01:00
markup Strip trailing newline in markdown code copy (#29019) (#29022) 2024-02-13 14:17:07 +01:00
modules Polyfill SubmitEvent for PaleMoon (#28441) (#28478) 2023-12-22 12:05:11 +01:00
render Use vitest globals (#27102) (#27311) 2023-09-27 16:10:08 +02:00
standalone [API] Forgejo API /api/forgejo/v1 2023-11-13 12:33:48 +01:00
test Avoid duplicate JS error messages on UI (#28873) (#28881) 2024-01-31 14:18:25 +01:00
utils Polyfill SubmitEvent for PaleMoon (#28441) (#28478) 2023-12-22 12:05:11 +01:00
vendor Vendor `jquery.are-you-sure` with strict mode fixes (#26901) 2023-09-06 00:02:44 +00:00
webcomponents Fix gitea-origin-url with default ports (#29085) (#29088) 2024-02-13 14:17:58 +01:00
bootstrap.js Avoid duplicate JS error messages on UI (#28873) (#28881) 2024-01-31 14:18:25 +01:00
bootstrap.test.js Avoid duplicate JS error messages on UI (#28873) (#28881) 2024-01-31 14:18:25 +01:00
index.js Hide archived labels by default from the suggestions when assigning labels for an issue (#27451) (#27661) 2023-10-17 14:46:35 +00:00
jquery.js Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055) 2020-04-18 18:46:29 -04:00
svg.js Replace ajax with fetch, improve image diff (#27267) (#27583) 2023-10-11 16:12:31 +02:00
svg.test.js Use vitest globals (#27102) (#27311) 2023-09-27 16:10:08 +02:00
utils.js Replace ajax with fetch, improve image diff (#27267) (#27583) 2023-10-11 16:12:31 +02:00
utils.test.js Use vitest globals (#27102) (#27311) 2023-09-27 16:10:08 +02:00