Showing 2 of 2 files from the diff.

@@ -305,7 +305,8 @@
Loading
305 305
		_, _ = io.WriteString(w, tplSampleJobsManage(tplSampleJobEdit("", `<div class="alert alert-danger" id="sjsa"><button type="button" class="close" onclick="$('#sjsa').fadeOut('fast');">×</button><span> Save sample job error</span></div>`), server))
306 306
		return
307 307
	}
308 -
	http.Redirect(w, r, "/sample?action=manageSamples", 301)
308 +
	w.Header().Set("Location", "./sample?action=manageSamples")
309 +
	w.WriteHeader(307)
309 310
}
310 311
311 312
// editSample provide method to update a sample job.
@@ -323,9 +324,11 @@
Loading
323 324
	for _, j := range sampleJobs.Jobs {
324 325
		for _, v := range j.Tubes {
325 326
			for _, s := range selfConf.Servers {
327 +
				serverList.Reset()
326 328
				serverList.WriteString(`<li><a href="./tube?server=`)
327 329
				serverList.WriteString(s)
328 330
				serverList.WriteString(`&tube=`)
331 +
				serverList.WriteString(v)
329 332
				serverList.WriteString(`&action=loadSample&key=`)
330 333
				serverList.WriteString(j.Key)
331 334
				serverList.WriteString(`&redirect=`)

@@ -41,7 +41,8 @@
Loading
41 41
	server := r.URL.Query().Get("removeServer")
42 42
	removeServerInCookie(server, w, r)
43 43
	removeServerInConfig(server)
44 -
	http.Redirect(w, r, "/public", 301)
44 +
	w.Header().Set("Location", "./public")
45 +
	w.WriteHeader(307)
45 46
}
46 47
47 48
// handlerServer handle request on router: /server
@@ -92,22 +93,25 @@
Loading
92 93
// handleRedirect handle request with redirect response.
93 94
func handleRedirect(w http.ResponseWriter, r *http.Request, server string, tube string, action string, count string) {
94 95
	var link strings.Builder
95 -
	link.WriteString(`/tube?server=`)
96 +
	link.WriteString(`./tube?server=`)
96 97
	link.WriteString(server)
97 98
	link.WriteString(`&tube=`)
98 99
	switch action {
99 100
	case "kick":
100 101
		kick(server, tube, count)
101 102
		link.WriteString(url.QueryEscape(tube))
102 -
		http.Redirect(w, r, link.String(), 302)
103 +
		w.Header().Set("Location", link.String())
104 +
		w.WriteHeader(307)
103 105
	case "kickJob":
104 106
		kickJob(server, tube, r.URL.Query().Get("jobid"))
105 107
		link.WriteString(url.QueryEscape(tube))
106 -
		http.Redirect(w, r, link.String(), 302)
108 +
		w.Header().Set("Location", link.String())
109 +
		w.WriteHeader(307)
107 110
	case "pause":
108 111
		pause(server, tube, count)
109 112
		link.WriteString(url.QueryEscape(tube))
110 -
		http.Redirect(w, r, link.String(), 302)
113 +
		w.Header().Set("Location", link.String())
114 +
		w.WriteHeader(307)
111 115
	case "moveJobsTo":
112 116
		destTube := tube
113 117
		if r.URL.Query().Get("destTube") != "" {
@@ -115,19 +119,23 @@
Loading
115 119
		}
116 120
		moveJobsTo(server, tube, destTube, r.URL.Query().Get("state"), r.URL.Query().Get("destState"))
117 121
		link.WriteString(url.QueryEscape(destTube))
118 -
		http.Redirect(w, r, link.String(), 302)
122 +
		w.Header().Set("Location", link.String())
123 +
		w.WriteHeader(307)
119 124
	case "deleteAll":
120 125
		deleteAll(server, tube)
121 126
		link.WriteString(url.QueryEscape(tube))
122 -
		http.Redirect(w, r, link.String(), 302)
127 +
		w.Header().Set("Location", link.String())
128 +
		w.WriteHeader(307)
123 129
	case "deleteJob":
124 130
		deleteJob(server, tube, r.URL.Query().Get("jobid"))
125 131
		link.WriteString(url.QueryEscape(tube))
126 -
		http.Redirect(w, r, link.String(), 302)
132 +
		w.Header().Set("Location", link.String())
133 +
		w.WriteHeader(307)
127 134
	case "loadSample":
128 135
		loadSample(server, tube, r.URL.Query().Get("key"))
129 136
		link.WriteString(url.QueryEscape(tube))
130 -
		http.Redirect(w, r, link.String(), 302)
137 +
		w.Header().Set("Location", link.String())
138 +
		w.WriteHeader(307)
131 139
	}
132 140
	_, _ = io.WriteString(w, tplTube(currentTube(server, tube), server, tube))
133 141
}
@@ -158,7 +166,8 @@
Loading
158 166
		return
159 167
	case "deleteSample":
160 168
		deleteSamples(r.URL.Query().Get("key"))
161 -
		http.Redirect(w, r, "/sample?action=manageSamples", 301)
169 +
		w.Header().Set("Location", "./sample?action=manageSamples")
170 +
		w.WriteHeader(307)
162 171
		return
163 172
	}
164 173
}
Files Coverage
cookies.go 96.88%
currentTube.go 100.00%
currentTubeJobs.go 100.00%
currentTubeJobsActionsRow.go 97.06%
currentTubeJobsShowcase.go 94.55%
currentTubeJobsSummaryTable.go 90.48%
currentTubeSearchResults.go 100.00%
handlers.go 93.84%
lib.go 84.98%
main.go 18.37%
modalAddJob.go 100.00%
modalAddSample.go 100.00%
modalClearTubes.go 100.00%
sampleJobUtils.go 69.20%
statisticsUtils.go 80.92%
tplFilter.go 100.00%
tplMain.go 100.00%
tplNav.go 98.70%
tplSampleJobEdit.go 79.73%
tplSampleJobsManage.go 100.00%
tplSearchTube.go 100.00%
tplServer.go 100.00%
tplStatistic.go 100.00%
tplStatisticEdit.go 100.00%
tplStatisticSetting.go 100.00%
tplTube.go 100.00%
utils.go 75.52%
Project Totals (27 files) 86.68%
31.1
TRAVIS_OS_NAME=linux
1.10.x=.10.x
31.2
TRAVIS_OS_NAME=linux
1.10.x=.10.x
31.4
1.11.x=.11.x
TRAVIS_OS_NAME=linux
31.3
1.11.x=.11.x
TRAVIS_OS_NAME=linux
31.7
1.13.x=.13.x
TRAVIS_OS_NAME=linux
31.6
TRAVIS_OS_NAME=linux
1.12.x=.12.x
31.5
TRAVIS_OS_NAME=linux
1.12.x=.12.x
31.8
1.13.x=.13.x
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading