-
-
Notifications
You must be signed in to change notification settings - Fork 151
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 open graph urls for RECAP pdfs #3094
Merged
Merged
Commits on Sep 4, 2023
-
fix(opengraph): Override open graph urls for RECAP pdfs
These are a special case where we redirect opengraph bots to /recap/og-lookup/?file_path=/recap/the/path so that they can get their opengraph content. Previously, this page was using the og:url from the base.html template, which doesn't include the query parameters. This means that clients who depend on the og:url property for the click action on an opengraph card (e.g. Mastodon) were getting URLs that 404ed when you click the preview card but not the link in the content that generated it. The og:url would always be `courtlistener.com/recap/og-lookup/` which of course 404s since the query param it's expecting isn't present. To fix, override the template on recap_document.html. Pass an `og_file_path` argument when we do the redirect and check for it in the template.
Configuration menu - View commit details
-
Copy full SHA for 09ba479 - Browse repository at this point
Copy the full SHA 09ba479View commit details -
Can't reverse for view attachments with og_file_path param. Need to look more closely at getting correct og:url for attachments.
Configuration menu - View commit details
-
Copy full SHA for 7d28ad6 - Browse repository at this point
Copy the full SHA 7d28ad6View commit details -
This way it will work when we redirect to the first attachment as well as the regular case.
Configuration menu - View commit details
-
Copy full SHA for 4cdcf3f - Browse repository at this point
Copy the full SHA 4cdcf3fView commit details
Commits on Sep 5, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 4e84ddc - Browse repository at this point
Copy the full SHA 4e84ddcView commit details
Commits on Sep 6, 2023
-
Only override og:url if we're serving a redirected og crawler
is_og_bot will be false normally and only true when view_recap_document is invoked via redirect_og_lookup. If false, None will be sent to the template and will use og:url value from base.html template.
Configuration menu - View commit details
-
Copy full SHA for a912ad9 - Browse repository at this point
Copy the full SHA a912ad9View commit details -
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Configuration menu - View commit details
-
Copy full SHA for 8083bae - Browse repository at this point
Copy the full SHA 8083baeView commit details
Commits on Sep 7, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 9b97802 - Browse repository at this point
Copy the full SHA 9b97802View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.