-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement GDPR compliance workaround
- Loading branch information
sd109
committed
May 1, 2024
1 parent
934d0ea
commit 7d0548f
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
SOURCE_CODE_PATH=/usr/local/lib/python3.11/site-packages/gradio/ | ||
|
||
# Strip out preconnect directives from HTML <link> tags | ||
find $SOURCE_CODE_PATH -name "*.html" -type f -exec sed -i s!'rel="preconnect"'!!g {} \; | ||
|
||
# Replace links with something harmless but identifiable | ||
declare -a LINKS=("https://fonts.gstatic.com" "https://fonts.googleapis.com") | ||
REPLACEMENT="no-google-fonts-here" | ||
for item in "${LINKS[@]}"; do | ||
find $SOURCE_CODE_PATH -name "*.html" -type f -exec sed -i s!$item!$REPLACEMENT!g {} \; | ||
done |