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.
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
Rewrite images to use local proxy #4035
Rewrite images to use local proxy #4035
Changes from 15 commits
c2584d3
3be2a55
44d8168
650e3a7
fc66bad
540560b
aaf3833
89976b8
ef79422
ae96d86
7306153
aa49a1b
f057abf
986913d
388eb42
98b5746
45f5448
9b40d74
95025ad
bf20539
c8c355d
5507d2d
97697aa
ed3e2e0
c2a763d
7fbfa48
7068419
ecd8e3b
66229ab
d6b3d82
abe3ab2
a5dc167
6257469
289c55d
bf6b0a5
6232fa0
11cf93b
3d698dd
becf54c
06257f9
4c2fe13
5f79a3c
dc17cb1
d793d80
1f29e72
3399917
a88f4d6
518af87
4fc857a
7e5e455
81359e2
7930b57
2fd7edd
b600bc5
0a6a587
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
It isn't clear that
RemoteImage::create()
shouldn't run if the setting for cache_external_images is false, or proxy_images is true. Maybe should do a check on that setting before trying to create it.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.
RemoteImage is only written if the image is getting proxied. The table only exists to check that this url is valid for proxying, so there is no need to create it otherwise.
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.
I've been trying to remove early returns wherever possible. So maybe
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.
Whats wrong with early returns? To me they are much clearer than unnecessary intendation.
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.
Really help with logical control flow. A few months ago I went through a lot of these removing as many
return
statements as I could. Some functions had like 4 early returns, and it was difficult to follow the chain of ifs / matches.