-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(server): use fqdn for og:image meta tag value #11082
fix(server): use fqdn for og:image meta tag value #11082
Conversation
web/src/routes/(user)/share/[key]/[[photos=photos]]/[[assetId=id]]/+page.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit pointless since the change isn't server side rendered. You should take a look at api.service.ts in the server repository instead. There is also an e2e test for shared links that checks this specific functionality.
8cc8670
to
ab26cf6
Compare
i've addressed the comments, lints and tests. there is likely some opportunity to improve the approach (SSR vs web) to improve future DX concerns, but they could be decoupled from this PR as well. i am open to either. thanks for the feedback so far. |
000c46c
to
07dc23a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks a lot better.
25ce639
to
0cae9d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, the only issue iM thinking about now is if the extension domain has a trailing slash or not? Did you test both situations? Alternatively new URL(path, domain).href would probably fix the issue as well
i didn't test that! i just dove in assuming i've pushed updates now to better assemble the host and pathname/query params and have successfully tested with trailing slashes. |
8abfaa6
to
c6ea55a
Compare
I mean, we probably should validate/normalize it lol. Maybe in a follow up PR we'll fix it all? |
I'll fix the tests |
opengraph image specifies that the url contains http or https, thus implying a fqdn. this change uses the external domain from the server config to attempt to make the og:image have both the existing path to the thumbnail along with the desired domain if the server setting is empty, the old behavior will persist please note, some og implementations do work with relative paths, so not all og image checkers may still pass, but not all implementations have this fallback and thus will not find the image otherwise
c6ea55a
to
d0a0e52
Compare
also fixes lint and address the imageURL type which is optional
locally, lint, e2e and svelte check now all pass for me |
@jrasm91 I assume I don't have to keep this PR updated until further notice. let me know if there are additional requirements or actions I can take. |
Correct. It has just been a busy week, but I will try to get it merged in next week. |
thanks for all the feedback and i appreciate understanding the next steps. I mostly wanted clarification that I don't need to monitor the PR anymore. all sounds good to me, it will land when it lands! |
opengraph image specifies that the url contains http or https, thus implying a fqdn.
this change uses the external domain from the server config to attempt to make the og:image have both the existing path to the thumbnail along with the desired domain
please note, some og implementations do work with relative paths, so not all og image checkers may still pass, but not all implementations have this fallback and thus will not find the image otherwise
fix #11081