Przeglądaj źródła

FileServer.st: exit handlePUTRequest: if authentication failed

Manfred Kroehnert 11 lat temu
rodzic
commit
a6051cc775
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      server/FileServer.st

+ 3 - 3
server/FileServer.st

@@ -71,7 +71,7 @@ base64Decode: aString
 	<return (new Buffer(aString, 'base64').toString())>
 !
 
-isAuthenticated: aRequest response: aResponse
+isAuthenticated: aRequest
 	"Basic HTTP Auth: http://stackoverflow.com/a/5957629/293175
 	 and https://gist.github.com/1686663"
 	| header token auth parts|
@@ -119,8 +119,8 @@ handleGETRequest: aRequest respondTo: aResponse
 
 handlePUTRequest: aRequest respondTo: aResponse
 	| file stream |
-	(self isAuthenticated: aRequest response: aResponse)
-		ifFalse: [self respondAuthenticationRequiredTo: aResponse].
+	(self isAuthenticated: aRequest)
+		ifFalse: [self respondAuthenticationRequiredTo: aResponse. ^nil].
 
 	file := '.', aRequest url.
 	stream := fs createWriteStream: file.