Browse Source

Actually show Node ID in QR (fixes #471)

Jakob Borg 11 years ago
parent
commit
f288e00c37
3 changed files with 3 additions and 3 deletions
  1. 0 0
      auto/gui.files.go
  2. 2 2
      cmd/syncthing/gui.go
  3. 1 1
      gui/index.html

File diff suppressed because it is too large
+ 0 - 0
auto/gui.files.go


+ 2 - 2
cmd/syncthing/gui.go

@@ -526,8 +526,8 @@ func restPostUpgrade(w http.ResponseWriter, r *http.Request) {
 }
 
 func getQR(w http.ResponseWriter, r *http.Request) {
-	r.ParseForm()
-	text := r.FormValue("text")
+	var qs = r.URL.Query()
+	var text = qs.Get("text")
 	code, err := qr.Encode(text, qr.M)
 	if err != nil {
 		http.Error(w, "Invalid", 500)

+ 1 - 1
gui/index.html

@@ -404,7 +404,7 @@
 
   <modal id="idqr" large="yes" status="info" close="yes" icon="qrcode" title="{{'Node Identification' | translate}} &mdash; {{nodeName(thisNode())}}">
     <div class="well well-sm text-monospace text-center">{{myID}}</div>
-    <img ng-if="myID" class="center-block img-thumbnail" src="qr/{{myID}}"/>
+    <img ng-if="myID" class="center-block img-thumbnail" src="qr/?text={{myID}}"/>
   </modal>
 
   <!-- Node editor modal -->

Some files were not shown because too many files changed in this diff