Browse Source

Extract #response:

Herby Vojčík 7 years ago
parent
commit
30fd8c376c
1 changed files with 7 additions and 2 deletions
  1. 7 2
      src/Znock/ZnockBase.class.st

+ 7 - 2
src/Znock/ZnockBase.class.st

@@ -44,8 +44,7 @@ ZnockBase >> doesNotUnderstand: aMessage [
 		self request.
 		^ aMessage sendTo: builtClient ].
 	(self responseCreationSelectors includes: aMessage selector) ifTrue: [
-		self response ifNotNil: [ self error: 'Response already created' ].
-		^ builtClient response: (aMessage sendTo: ZnResponse) ].
+		^ self response: (aMessage sendTo: ZnResponse) ].
 	(self responseSelectors includes: aMessage selector) ifTrue: [
 		self response.
 		^ aMessage sendTo: builtClient response ].
@@ -88,6 +87,12 @@ ZnockBase >> response [
 	^ builtClient response
 ]
 
+{ #category : #building }
+ZnockBase >> response: response [
+	self response ifNotNil: [ self error: 'Response already created' ].
+	builtClient response: response
+]
+
 { #category : #building }
 ZnockBase >> responseCreationSelectors [
 	^ #(accepted noContent notModified ok: redirect: redirect:entity: serverError: serverErrorWithEntity: statusCode: statusLine: unauthorized unauthorized: unauthorized:entity:)