Closed anuragdhingra closed 3 years ago
ah... nice catch. You caught the problem correctly. Thank you.
If og:url
exists, it should be preferred over the URL
which is parsed from initial input.
Thus, we don't need Value
field in opengraph.URL
, but just overwrite it if og:url
exists.
What do you think?
The reason I would prefer a different value is that if og.URL
is overwritten we won't have any clear mechanism to know if it was fetched from the meta tag or is the default value. Also, I believe maybe passing the value as string
instead of URL
would be better due to validity issues. What do you think?
What kind of validity do you mean?
What kind of validity do you mean?
If the content/URL set on og:url
meta property is invalid then parsing it might cause an error which might not be what we want maybe? Just returning back the content fetched from the property as string
should be okay acc. to me.
Also, if we overrite it do we have any way to check if og.url
property was found or not?
Closing this now. Thank you!
@otiai10 In the current implementation,
opengraph.URL
defaults to the parsed request URL and doesn't maps theog.url
meta tag. Is it okay to add a new field calledValue
inopengraph.URL
struct which maps theog.url
meta tag value?Or if I am missing something here, please let me know. I want fetch the
og.url
meta tag from the parsed HTML. Thank you.