Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alex Gleason
pleroma
Commits
18438a9b
Commit
18438a9b
authored
4 years ago
by
feld
Browse files
Options
Downloads
Patches
Plain Diff
Add "Bot" to User Agent to coerce Twitter into serving OGP <meta> tags.
parent
4b53499b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
lib/pleroma/web/rich_media/parser.ex
+4
-1
4 additions, 1 deletion
lib/pleroma/web/rich_media/parser.ex
with
5 additions
and
1 deletion
CHANGELOG.md
+
1
−
0
View file @
18438a9b
...
...
@@ -76,6 +76,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
-
Resolving Peertube accounts with Webfinger
-
`blob:`
urls not being allowed by connect-src CSP
-
Mastodon API: fix
`GET /api/v1/notifications`
not returning the full result set
-
Rich Media Previews for Twitter links
## [Unreleased (patch)]
...
...
This diff is collapsed.
Click to expand it.
lib/pleroma/web/rich_media/parser.ex
+
4
−
1
View file @
18438a9b
...
...
@@ -86,7 +86,10 @@ defp parse_url(url) do
end
try
do
{
:ok
,
%
Tesla
.
Env
{
body:
html
}}
=
Pleroma
.
HTTP
.
get
(
url
,
[],
adapter:
opts
)
rich_media_agent
=
Pleroma
.
Application
.
user_agent
()
<>
"; Bot"
{
:ok
,
%
Tesla
.
Env
{
body:
html
}}
=
Pleroma
.
HTTP
.
get
(
url
,
[{
"user-agent"
,
rich_media_agent
}],
adapter:
opts
)
html
|>
parse_html
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment