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

リモートから添付されてきたクリップURLにホスト情報があると二重になる不具合を修正 #460

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG_YOJO.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Cherrypick 4.11.1
- Fix: リアクションが閲覧できる状態でも見れない問題を修正 [#429](https://github.com/yojo-art/cherrypick/pull/429)
- Enhance: チャートの連合グラフで割合を表示
- Enhance: お気に入り登録クリップの一覧画面から登録解除できるように
- Fix: リモートから添付されてきたクリップURLにホスト情報があると二重になる不具合を修正 [#460](https://github.com/yojo-art/cherrypick/pull/460)

### Server
-
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/components/MkLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ const props = withDefaults(defineProps<{
let self = props.url.startsWith(local);
let requestUrl = new URL(props.url);
if (props.host === requestUrl.host && requestUrl.pathname.startsWith('/clips/')) {
requestUrl = new URL(local + requestUrl.pathname + '@' + props.host);
let split = requestUrl.pathname.split('@');
requestUrl = new URL(local + split[0] + '@' + (split.length >= 2 ? split[1] : props.host));
self = true;
}
const url_string = requestUrl.toString();
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/components/MkUrlPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ let self = props.url.startsWith(local);
let requestUrl = new URL(props.url);
let url_string: string;
if (props.host === requestUrl.host && requestUrl.pathname.startsWith('/clips/')) {
requestUrl = new URL(local + requestUrl.pathname + '@' + props.host);
let split = requestUrl.pathname.split('@');
requestUrl = new URL(local + split[0] + '@' + (split.length >= 2 ? split[1] : props.host));
self = true;
url_string = requestUrl.toString();
requestUrl = new URL(props.url);
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/components/global/MkUrl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ let url = new URL(props.url);
if (!['http:', 'https:'].includes(url.protocol)) throw new Error('invalid url');

if (props.host === url.host && url.pathname.startsWith('/clips/')) {
url = new URL(local + url.pathname + '@' + props.host);
let split = url.pathname.split('@');
url = new URL(local + split[0] + '@' + (split.length >= 2 ? split[1] : props.host));
self = true;
}
const url_string = url.toString();
Expand Down
Loading