Skip to content

Commit 7aec87a

Browse files
committed
Handling 404 error fixed
1 parent 95ed8a9 commit 7aec87a

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [0.4.7] - 2021-07-25
2+
3+
- Handling 404 error fixed
4+
15
## [0.4.6] - 2021-07-25
26

37
- Content duplication fixed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
yaframework (0.4.6)
4+
yaframework (0.4.7)
55
rack (~> 2.2, >= 2.2.3)
66

77
GEM

lib/yaframework/base.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,15 @@ def compile(path, &handler)
5555
end
5656

5757
def route_eval
58+
route = find_route
59+
response.status = 404 unless route
60+
5861
if @inbox[response.status]
5962
response.write instance_eval(&@inbox[response.status])
6063
return response.finish
6164
end
6265

63-
route = find_route
64-
if route
65-
response.write instance_eval(&route[:handler])
66-
else
67-
response.status = 404
68-
end
66+
response.write instance_eval(&route[:handler]) if route
6967
response.finish
7068
end
7169

lib/yaframework/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Yaframework
4-
VERSION = "0.4.6"
4+
VERSION = "0.4.7"
55
end

0 commit comments

Comments
 (0)