File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,6 +224,11 @@ def to_str
224224 # Encode this application path as a URL path.
225225 # @returns [Protocol::URL::Path] The encoded URL path.
226226 def to_url_path
227+ # Preserve Utopia's compact representation of the absolute root:
228+ if @components == [ "" ]
229+ return Protocol ::URL ::Path [ SEPARATOR ]
230+ end
231+
227232 return Protocol ::URL ::Path . for (
228233 @components ,
229234 encoding : Protocol ::URL ::Encoding ::System ,
Original file line number Diff line number Diff line change 140140 end
141141
142142 with "#to_url_path" do
143+ it "preserves the absolute root" do
144+ path = Utopia ::Path . root
145+
146+ expect ( path . to_url_path ) . to be == Protocol ::URL ::Path [ "/" ]
147+ end
148+
143149 it "encodes application path components" do
144150 path = Utopia ::Path . new ( [ "" , "some path" ] )
145151
You can’t perform that action at this time.
0 commit comments