Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#58865 closed defect (bug) (fixed)

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

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

Description

Code is here: ​https://github.com/WordPress/wordpress-develop/blob/f4fa4dd1bab07b3b4d90ece4f988d2adcacc4733/src/wp-includes/class-wp-customize-manager.php#L1911C55-L1911C55

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 3 years ago.
58865.2.diff​ (622 bytes ) - added by rajinsharwar 3 years ago.
The diff of the patch
58865.patch​ (615 bytes ) - added by elrae 3 years ago.

Download all attachments as: .zip

Change History (11)

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


3 years ago
#1

  • Keywords has-patch added

Changing the X Robots header to X Robots Tag

Trac ticket: https://core.trac.wordpress.org/ticket/58865

#2 @audrasjb
3 years ago

  • Milestone Awaiting Review → 6.4
  • Owner set to audrasjb
  • Status new → accepted
  • Version 6.2.2

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

@dhruvishah2203
3 years ago

@rajinsharwar
3 years ago

The diff of the patch

#3 @audrasjb
3 years 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
3 years 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
3 years 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.

@elrae
3 years ago

#6 @elrae
3 years 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.


3 years ago
#7

Trac ticket:

#8 @adamsilverstein
3 years ago

  • Resolution → fixed
  • Status accepted → 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.