Closed denisdefreyne closed 6 years ago
Migrated from #1063:
In a compile rule, interpret write nil the same as routing to nil. Steps to reproduce compile '/foo.*' do write nil end Expected behavior Item '/foo.*' should be routed to nil, just as if: route '/foo.*' do nil end had been specified. Actual behavior Item '/foo.*' is unexpectedly routed by some other routing rule (typically, the catchall route '/**/*', thus to /foo/index.html). Details Given that simple routing rules can be expressed more concisely via write inside a compile rule, and that: compile '/foo.*' do end route '/foo.*' do '/foo/index.html' end can be transformed into: compile '/foo.*' do write '/foo/index.html' end one would intuitively expect that: compile '/foo.*' do end route '/foo.*' do nil end can likewise be transformed to: compile '/foo.*' do write nil end but this does not work as expected.
In a compile rule, interpret write nil the same as routing to nil.
compile
write nil
nil
compile '/foo.*' do write nil end
Item '/foo.*' should be routed to nil, just as if:
route '/foo.*' do nil end
had been specified.
Item '/foo.*' is unexpectedly routed by some other routing rule (typically, the catchall route '/**/*', thus to /foo/index.html).
route '/**/*'
/foo/index.html
Given that simple routing rules can be expressed more concisely via write inside a compile rule, and that:
write
compile '/foo.*' do end route '/foo.*' do '/foo/index.html' end
can be transformed into:
compile '/foo.*' do write '/foo/index.html' end
one would intuitively expect that:
compile '/foo.*' do end route '/foo.*' do nil end
can likewise be transformed to:
but this does not work as expected.
Migrated from #1063: