Make WordPress Core

Opened 9 months ago

Closed 8 months ago

#58865 closed defect (bug) (fixed)

HTTP Header typo X-Robots instead of X-Robots-Tag

Reported by: michelleblanchette's profile michelleblanchette Owned by: audrasjb's profile audrasjb
Milestone: 6.4 Priority: normal
Severity: minor Version:
Component: Customize Keywords: has-patch changes-requested
Focuses: Cc:


Code is here:

It seems X-Robots is not a valid HTTP header. The correct header is X-Robots-Tag.

Looking at the git blame, this was apparently introduced 7 years ago and hasn't been touched since.

Attachments (3)

58865.diff (622 bytes) - added by dhruvishah2203 9 months ago.
58865.2.diff (622 bytes) - added by rajinsharwar 9 months ago.
The diff of the patch
58865.patch (615 bytes) - added by elrae 8 months ago.

Download all attachments as: .zip

Change History (11)

This ticket was mentioned in PR #4873 on WordPress/wordpress-develop by @rajinsharwar.

9 months ago

  • Keywords has-patch added

Changing the X Robots header to X Robots Tag

Trac ticket:

#2 @audrasjb
9 months ago

  • Milestone changed from Awaiting Review to 6.4
  • Owner set to audrasjb
  • Status changed from new to accepted
  • Version 6.2.2 deleted

Thanks for the ticket and patch!
Self assigning for 6.4 commit consideration.

9 months ago

The diff of the patch

#3 @audrasjb
9 months ago

@dhruvishah2203 @rajinsharwar thanks for the patches, but I don't really get the point of copying the pull request that was already sent into a new patch (and especially @rajinsharwar since it was your own PR).

#4 @rajinsharwar
9 months ago

Hey @audrasjb, I might have been confused, as I saw @dhruvishah2203 attaching a patch file, I also thought that I need to attach that as well. Will take a note from the next.

#5 @jorbin
8 months ago

  • Keywords changes-requested added

While x-robots-tag is the standard, since this has been in place for so long it is possible that someone is using this information in a reverse proxy cache or in some other way. As such, I think the removal of the x-robots header is a bad idea and instead we should simply add the correct header.

8 months ago

#6 @elrae
8 months ago

Good point @jorbin I added a new patch which just adds the new header rather than replacing it.

This ticket was mentioned in PR #5079 on WordPress/wordpress-develop by @adamsilverstein.

8 months ago

Trac ticket:

#8 @adamsilverstein
8 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 56462:

Customizer: use the correct X-Robots-Tag header.

Fix an issue where the X-Robots header was used instead of the X-Robots-Tag header. Using X-Robots-Tag yields the correct behavior that the original code intended to add. X-Robots is left in place for backward compatibility.

Props michelleblanchette, dhruvishah2203, rajinsharwar, jorbin, hztyfoon, elrae. 

Fixes #58865.

Note: See TracTickets for help on using tickets.