diff --git a/test/issue1336-registry/api/packages/gitcompatibledubpackage/info?minimize=true b/test/issue1336-registry/api/packages/gitcompatibledubpackage/info?minimize=true deleted file mode 100644 index 6f0d641..0000000 --- a/test/issue1336-registry/api/packages/gitcompatibledubpackage/info?minimize=true +++ /dev/null @@ -1 +0,0 @@ -{"repository":{"project":"gitcompatibledubpackage","owner":"dlang-community","kind":"github"},"dateAdded":"2017-02-11T21:00:16","name":"gitcompatibledubpackage","categories":[],"owner":"5148973d2179ddb20b0002fd","id":"589f6d501c18646d0ee49f12","versions":[{"packageDescriptionFile":"dub.sdl","configurations":[{"name":"exe","targetType":"executable","mainSourceFile":"hello.d"},{"excludedSourceFiles":["hello.d"],"name":"lib","targetType":"library"}],"commitID":"9e3972be4c63790c32257220f40c0af7dc41bec5","importPaths":[".."],"name":"gitcompatibledubpackage","version":"~master","license":"public domain","readmeFile":"/README.md","date":"2017-09-18T18:18:35Z","description":"Example of a DUB package also usable as git submodule. For DUB test suite.","sourcePaths":["."]},{"packageDescriptionFile":"dub.json","commitID":"b62466d32dd6bbb0d45f9a73c91142205d1048e5","importPaths":[".."],"name":"gitcompatibledubpackage","version":"1.0.1","license":"public domain","readmeFile":"/README.md","date":"2015-10-31T11:09:14Z","description":"Example of a DUB package also usable as git submodule. For DUB test suite."},{"packageDescriptionFile":"dub.json","commitID":"cef89b5513a140b1e3417809f59d1957ddaad837","importPaths":[".."],"name":"gitcompatibledubpackage","version":"1.0.2","license":"public domain","readmeFile":"/README.md","date":"2015-10-31T11:23:53Z","description":"Example of a DUB package also usable as git submodule. For DUB test suite.","sourcePaths":["."]},{"packageDescriptionFile":"dub.json","commitID":"d36e49d31b26ea76e1670e9d5cd89aaac40fde75","importPaths":[".."],"name":"gitcompatibledubpackage","version":"1.0.3","targetType":"executable","license":"public domain","readmeFile":"/README.md","date":"2017-04-05T22:12:48Z","description":"Example of a DUB package also usable as git submodule. For DUB test suite.","mainSourceFile":"hello.d","sourcePaths":["."]},{"packageDescriptionFile":"dub.sdl","configurations":[{"name":"exe","targetType":"executable","mainSourceFile":"hello.d"},{"excludedSourceFiles":["hello.d"],"name":"lib","targetType":"library"}],"commitID":"9e3972be4c63790c32257220f40c0af7dc41bec5","importPaths":[".."],"name":"gitcompatibledubpackage","version":"1.0.4","license":"public domain","readmeFile":"/README.md","date":"2017-09-18T18:18:35Z","description":"Example of a DUB package also usable as git submodule. For DUB test suite.","sourcePaths":["."]}]} \ No newline at end of file diff --git a/test/issue1336-registry/api/packages/gitcompatibledubpackage/info__minimize=true b/test/issue1336-registry/api/packages/gitcompatibledubpackage/info__minimize=true new file mode 100644 index 0000000..6f0d641 --- /dev/null +++ b/test/issue1336-registry/api/packages/gitcompatibledubpackage/info__minimize=true @@ -0,0 +1 @@ +{"repository":{"project":"gitcompatibledubpackage","owner":"dlang-community","kind":"github"},"dateAdded":"2017-02-11T21:00:16","name":"gitcompatibledubpackage","categories":[],"owner":"5148973d2179ddb20b0002fd","id":"589f6d501c18646d0ee49f12","versions":[{"packageDescriptionFile":"dub.sdl","configurations":[{"name":"exe","targetType":"executable","mainSourceFile":"hello.d"},{"excludedSourceFiles":["hello.d"],"name":"lib","targetType":"library"}],"commitID":"9e3972be4c63790c32257220f40c0af7dc41bec5","importPaths":[".."],"name":"gitcompatibledubpackage","version":"~master","license":"public domain","readmeFile":"/README.md","date":"2017-09-18T18:18:35Z","description":"Example of a DUB package also usable as git submodule. For DUB test suite.","sourcePaths":["."]},{"packageDescriptionFile":"dub.json","commitID":"b62466d32dd6bbb0d45f9a73c91142205d1048e5","importPaths":[".."],"name":"gitcompatibledubpackage","version":"1.0.1","license":"public domain","readmeFile":"/README.md","date":"2015-10-31T11:09:14Z","description":"Example of a DUB package also usable as git submodule. For DUB test suite."},{"packageDescriptionFile":"dub.json","commitID":"cef89b5513a140b1e3417809f59d1957ddaad837","importPaths":[".."],"name":"gitcompatibledubpackage","version":"1.0.2","license":"public domain","readmeFile":"/README.md","date":"2015-10-31T11:23:53Z","description":"Example of a DUB package also usable as git submodule. For DUB test suite.","sourcePaths":["."]},{"packageDescriptionFile":"dub.json","commitID":"d36e49d31b26ea76e1670e9d5cd89aaac40fde75","importPaths":[".."],"name":"gitcompatibledubpackage","version":"1.0.3","targetType":"executable","license":"public domain","readmeFile":"/README.md","date":"2017-04-05T22:12:48Z","description":"Example of a DUB package also usable as git submodule. For DUB test suite.","mainSourceFile":"hello.d","sourcePaths":["."]},{"packageDescriptionFile":"dub.sdl","configurations":[{"name":"exe","targetType":"executable","mainSourceFile":"hello.d"},{"excludedSourceFiles":["hello.d"],"name":"lib","targetType":"library"}],"commitID":"9e3972be4c63790c32257220f40c0af7dc41bec5","importPaths":[".."],"name":"gitcompatibledubpackage","version":"1.0.4","license":"public domain","readmeFile":"/README.md","date":"2017-09-18T18:18:35Z","description":"Example of a DUB package also usable as git submodule. For DUB test suite.","sourcePaths":["."]}]} \ No newline at end of file diff --git a/test/test_registry.d b/test/test_registry.d index 7f270ad..f5d14c1 100755 --- a/test/test_registry.d +++ b/test/test_registry.d @@ -10,6 +10,9 @@ Provide a special API File Handler as Vibe.d's builtin serveStaticFiles doesn't deal well with query params. This will blindly check if the requestURI payload exists on the filesystem and if so, return the file. + +It replaces `?` with `__` for Windows compatibility. + Params: skip = initial part of the requestURI to skip over folder = the base directory from which to serve API requests from @@ -20,7 +23,8 @@ import std.algorithm : skipOver; import std.path : buildPath; import std.file : exists; - auto requestURI = req.requestURI; + // ? can't be part of path names on Windows + auto requestURI = req.requestURI.replace("?", "__"); requestURI.skipOver(skip); const reqFile = buildPath(folder, requestURI); if (reqFile.exists) {