Pastebin

Check-in [cd02f4f9a0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add explicit charset
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cd02f4f9a0fd1320c5d661dfd3e3267364205a556cc6ec6d16aeafdd6dfc1a00
User & Date: jef 2019-11-28 20:55:29
Context
2020-02-07
13:51
Update external modules check-in: e991879672 user: jef tags: trunk
2019-11-28
20:55
Add explicit charset check-in: cd02f4f9a0 user: jef tags: trunk
2019-11-19
12:50
Fix typo in pastebin-client check-in: f6a3a4cff8 user: jef tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to http.go.

208
209
210
211
212
213
214
215
216
217
218
219
220
221
222

	jsonBytes, err := json.MarshalIndent(pastes, "", "    ")
	if err != nil {
		http.Error(w, "error: unable to generate json", http.StatusForbidden)
		return
	}

	w.Header().Add("Content-type", "application/json")
	if len(pastes) == 0 {
		return
	}

	w.Write(jsonBytes)
}








|







208
209
210
211
212
213
214
215
216
217
218
219
220
221
222

	jsonBytes, err := json.MarshalIndent(pastes, "", "    ")
	if err != nil {
		http.Error(w, "error: unable to generate json", http.StatusForbidden)
		return
	}

	w.Header().Add("Content-type", "application/json; charset=utf-8")
	if len(pastes) == 0 {
		return
	}

	w.Write(jsonBytes)
}