Set headers on HTTP requests that GM originates

Patch for #1824.