Skip to content

Commit 948b0de

Browse files
committed
Fixed string injection error: undefined method `path='.
1 parent b4c0fbd commit 948b0de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/grape-swagger/doc_methods/path_string.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def build(route, options = {})
1919
route.path.sub!('/{version}', '')
2020
end
2121

22-
route.path = "#{GrapeSwagger::DocMethods::OptionalObject.build(:base_path, options)}#{route.path}" if options[:add_base_path]
22+
route.path.prepend(GrapeSwagger::DocMethods::OptionalObject.build(:base_path, options)) if options[:add_base_path]
2323

2424
[item, route.path.start_with?('/') ? route.path : "/#{route.path}"]
2525
end

0 commit comments

Comments
 (0)