Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(739)

Side by Side Diff: src/pkg/http/server.go

Issue 4620049: code review 4620049: http: make Headers be source of truth (Closed)
Patch Set: diff -r f5d2325ee229 https://go.googlecode.com/hg Created 13 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/http/reverseproxy_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // HTTP server. See RFC 2616. 5 // HTTP server. See RFC 2616.
6 6
7 // TODO(rsc): 7 // TODO(rsc):
8 // logging 8 // logging
9 9
10 package http 10 package http
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 return 398 return
399 } 399 }
400 400
401 // Did the handler supply any info? Enough? 401 // Did the handler supply any info? Enough?
402 if w.written == 0 || w.written >= min { 402 if w.written == 0 || w.written >= min {
403 return 403 return
404 } 404 }
405 405
406 // Is it a broken browser? 406 // Is it a broken browser?
407 var msg string 407 var msg string
408 » switch agent := w.req.UserAgent; { 408 » switch agent := w.req.UserAgent(); {
409 case strings.Contains(agent, "MSIE"): 409 case strings.Contains(agent, "MSIE"):
410 msg = "Internet Explorer" 410 msg = "Internet Explorer"
411 case strings.Contains(agent, "Chrome/"): 411 case strings.Contains(agent, "Chrome/"):
412 msg = "Chrome" 412 msg = "Chrome"
413 default: 413 default:
414 return 414 return
415 } 415 }
416 msg += " would ignore this error page if this text weren't here.\n" 416 msg += " would ignore this error page if this text weren't here.\n"
417 417
418 // Is it text? ("Content-Type" is always in the map) 418 // Is it text? ("Content-Type" is always in the map)
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 func (tw *timeoutWriter) WriteHeader(code int) { 1033 func (tw *timeoutWriter) WriteHeader(code int) {
1034 tw.mu.Lock() 1034 tw.mu.Lock()
1035 if tw.timedOut || tw.wroteHeader { 1035 if tw.timedOut || tw.wroteHeader {
1036 tw.mu.Unlock() 1036 tw.mu.Unlock()
1037 return 1037 return
1038 } 1038 }
1039 tw.wroteHeader = true 1039 tw.wroteHeader = true
1040 tw.mu.Unlock() 1040 tw.mu.Unlock()
1041 tw.w.WriteHeader(code) 1041 tw.w.WriteHeader(code)
1042 } 1042 }
OLDNEW
« no previous file with comments | « src/pkg/http/reverseproxy_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b