This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't include rel=canonical headers on IPRO resources.
Fixes #1222
- Loading branch information
1 parent
55e0962
commit 61f4e96
Showing
6 changed files
with
46 additions
and
3 deletions.
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
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
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 |
---|---|---|
|
@@ -89,6 +89,7 @@ fi | |
|
||
run_test content_length | ||
run_test keep_data_urls | ||
run_test rel_canonical | ||
|
||
wait_for_async_tests | ||
|
||
|
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,26 @@ | ||
start_test rel-canonical | ||
|
||
# .pagespeed. resources should have Link rel=canonical headers, IPRO resources | ||
# should not have them. | ||
|
||
start_test link rel=canonical header not present with IPRO resources | ||
|
||
REL_CANONICAL_REGEXP='Link:.*rel.*canonical' | ||
|
||
URL=$EXAMPLE_ROOT/images/Puzzle.jpg | ||
# Fetch it a few times until IPRO is done and has given it an ipro ("aj") etag. | ||
fetch_until -save "$URL" 'grep -c E[Tt]ag:.W/.PSA-aj.' 1 --save-headers | ||
# rel=canonical should not be present. | ||
check [ $(grep -c "$REL_CANONICAL_REGEXP" $FETCH_FILE) = 0 ] | ||
|
||
start_test link rel=canonical header present with pagespeed.ce resources | ||
|
||
URL=$REWRITTEN_ROOT/images/Puzzle.jpg.pagespeed.ce.HASH.jpg | ||
OUT=$($CURL -D- -o/dev/null -sS $URL) | ||
check_from "$OUT" grep "$REL_CANONICAL_REGEXP" | ||
|
||
start_test link rel=canonical header present with pagespeed.ic resources | ||
|
||
URL=$REWRITTEN_ROOT/images/xPuzzle.jpg.pagespeed.ic.HASH.jpg | ||
OUT=$($CURL -D- -o/dev/null -sS $URL) | ||
check_from "$OUT" grep "$REL_CANONICAL_REGEXP" |