File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * jQuery File Upload Plugin GAE Go Example 2.1.2
2
+ * jQuery File Upload Plugin GAE Go Example 2.1.3
3
3
* https://github.com/blueimp/jQuery-File-Upload
4
4
*
5
5
* Copyright 2011, Sebastian Tschan
@@ -219,10 +219,13 @@ func post(w http.ResponseWriter, r *http.Request) {
219
219
b , err := json .Marshal (handleUploads (r ))
220
220
check (err )
221
221
if redirect := r .FormValue ("redirect" ); redirect != "" {
222
- http .Redirect (w , r , fmt .Sprintf (
223
- redirect ,
224
- escape (string (b )),
225
- ), http .StatusFound )
222
+ if strings .Contains (redirect , "%s" ) {
223
+ redirect = fmt .Sprintf (
224
+ redirect ,
225
+ escape (string (b )),
226
+ )
227
+ }
228
+ http .Redirect (w , r , redirect , http .StatusFound )
226
229
return
227
230
}
228
231
w .Header ().Set ("Cache-Control" , "no-cache" )
You can’t perform that action at this time.
0 commit comments