godoc: set proper content-type header on share request

When sending the request to /share, it defaulted to
application/x-www-form-urlencoded. This caused the body to be
empty since it was sending a form with the actual code as a
key in the r.Form map.

Set the content type explicitly to text/plain.

Fixes golang/go#21691

Change-Id: I0d5981d9c9aa901010af65b0d0a7670870b77f2b
Reviewed-on: https://go-review.googlesource.com/86317
Reviewed-by: Andrew Bonventre <andybons@golang.org>
diff --git a/godoc/static/playground.js b/godoc/static/playground.js
index bea9c4b..51b00a4 100644
--- a/godoc/static/playground.js
+++ b/godoc/static/playground.js
@@ -403,6 +403,7 @@
         processData: false,
         data: sharingData,
         type: "POST",
+        contentType: "text/plain; charset=utf-8",
         complete: function(xhr) {
           sharing = false;
           if (xhr.status != 200) {
diff --git a/godoc/static/static.go b/godoc/static/static.go
index 8197d89..0711e51 100644
--- a/godoc/static/static.go
+++ b/godoc/static/static.go
@@ -1,4 +1,4 @@
-// Copyright 2017 The Go Authors. All rights reserved.
+// Copyright 2018 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -2599,6 +2599,7 @@
         processData: false,
         data: sharingData,
         type: "POST",
+        contentType: "text/plain; charset=utf-8",
         complete: function(xhr) {
           sharing = false;
           if (xhr.status != 200) {