Onebox follows redirects, which is usually a good thing, I guess.
This becomes a problem, however, when you share a link to a page requiring sign-in that simply redirects to a sign-in page when an anonymous user visits it.
For example, if I want to share my top secret project hosted at https://dgit.cs.uni-saarland.de/fefrei/my-top-secret-project/ in the internal category of our Discourse instance, this is what I get by default:
Note that all links in the Onebox go to https://dgit.cs.uni-saarland.de/users/sign_in, which is not helpful.
Of course, as a post author, I can prevent that by using any alternative markup that prevents the Onebox (which can’t show relevant content anyways); but if some other user does this and doesn’t notice, it’s pretty hard to retrieve the actual link.
As staff, I can edit the post to get the raw markup, but as a non-staff user, I think the only feasible workaround is to remember the magic /raw/ URL scheme.
Why does the Onebox link to the final location, not the original URL? Can we do something to improve this?
I typed https://dgit.cs.uni-saarland.de/fefrei/my-top-secret-project/, why should it link somewhere else?
When I’m redirected to the sign in page, this is fine, because I’m in a session – I can actually log in, and will be redirected back to the target URL.
When Discourse follows the redirect, forgets the original URL and just outputs the sign in URL, the reader has no (easy) way to get to the URL the author linked to.
I know that’s the current behavior, and already mentioned the workaround above:
I stumbled about this because another user fell for this trap, and I had to fish the actual link out of the raw view.
I’m not saying that this is terribad and needs to be fixed now or else; I’m just reporting that I find it sad that a user who simply pasted a link into his post got a Onebox that obfuscates the link in a way that makes it impossible for the average user to understand where to go. (There’s a reason I posted this in Contribute > Feature.)
최종 위치로 링크를 걸지 않기를 원하는 경우는, 링크를 공유하는 상대방이 인증된 상태이거나 링크된 사이트에서 인증할 수 있을 것으로 기대할 때입니다.
또한 외형적인 문제도 있습니다. 다른 커뮤니티에 discourse 스레드 링크를 게시했는데, 링크가 로그인 페이지를 가리키도록 변경되었습니다. 사람들이 의도적으로 로그인 페이지에 링크를 걸기 때문에 잘못된 링크를 올린 것이 아닌지 물어보았습니다. 결국 이는 사용자가 게시하고자 했던 내용을 변경하는 것입니다.
우회 방법은 유효하지만 좋지 않습니다. 특히 게시자와 링크를 클릭하는 사용자에게 나쁜 UX를 피하고 싶다면 더 지능적인 기본값이 있어야 합니다.
Discourse가 https://example.org/login을 요청하여 제목, 이미지 등을 가져옵니다.
Discourse가 https://example.org/login에서 가져온 정보를 보여주는 원박스(Onebox)를 표시합니다. 그리고 https://example.org/login으로 링크합니다. 생성된 원박스는 어디에도 https://example.org/a로 링크하지 않습니다.
문제라고 생각하는 부분은 굵게 표시된 부분뿐입니다. 물론 링크를 따라 해당 위치에서 정보를 가져오는 것은 당연하지만, 원박스는 항상 제가 입력한 URL로 링크해야 합니다.
이것은 원박스가 로그인 페이지의 정보를 표시하는 것(그렇지 않으면 무엇을 표시해야 합니까?)에 관한 것이 아니라, 단순히 원박스 생성 과정에서 원래 링크 대상이 완전히 가려지는 문제에 관한 것입니다.
이것이 구현된다면, 제 원래 게시물에 있는 원박스는 여전히 동일한 모습으로 보이지만 https://dgit.cs.uni-saarland.de/fefrei/my-top-secret-project/로 링크하게 될 것입니다.
이 부분은 전혀 이견이 없는데, 로그인 페이지 예시를 직접 시도해 보시길 권합니다. 메타에 비공개 카테고리의 예시가 있을까요? 만약 그런 카테고리가 있고 제가 이 답글에 링크를 올렸다고 생각해 보세요. 원 박스(one boxes)의 작동 방식 때문에 그 링크가 어디로 가는지 알 수도, 해당 페이지에 접근할 수도 없게 됩니다.
원 박스가 최종 페이지의 내용을 표시하는 것에는 문제가 없지만, 원래 URL을 유지하지 않으면 이 시나리오에서 리디렉션이 의도한 대로 작동할 가능성이 완전히 사라집니다. 또한 원래 링크에 포함된 출처 표시 태그도 함께 사라지게 됩니다.