New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong encoding of '/$$$%' #1318

Closed
danielkasza opened this Issue Nov 4, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@danielkasza

danielkasza commented Nov 4, 2015

Hello,

I am not 100% sure if this is an issue or I am doing something wrong, but I could not find any reference to this problem.

I have a very simple vibe.d project:

import vibe.appmain;
import vibe.d;
import std.stdio;

void handleRequest(scope HTTPServerRequest req, scope HTTPServerResponse res) {
    writeln(req.path);
    res.writeBody(req.path, "text/plain");
}

shared static this() {
    auto settings = new HTTPServerSettings;
    settings.port = 9000;
    settings.bindAddresses = ["0.0.0.0"];

    listenHTTP(settings, &handleRequest);
}
{
    "name" : "firstvibe",
    "description" : "Hello World - A minimal DUB bundle.",
    "dependencies" : {
        "vibe-d": "~>0.7.26-rc.3"
    },
    "versions": ["VibeDefaultMain"]
}

This works fine for most paths, but if I try to open http://localhost:9000/$$$%#$@%, the process dies with this exception:

Task terminated with unhandled exception: Wrong encoding of '/$$$%'

Is there any way to properly handle this?

s-ludwig added a commit that referenced this issue Nov 4, 2015

@s-ludwig

This comment has been minimized.

Show comment
Hide comment
@s-ludwig

s-ludwig Nov 4, 2015

Member

I've committed a fix that emits an Exception instead of an AssertError as expected. This somehow got through in the PR review that was actually supposed to get this fixed. It will now result in an error message displayed in the browser (to avoid the error completely, replace "%" with "%25" to get valid URL encoding).

The fix will be in the upcoming 0.7.26 version.

Member

s-ludwig commented Nov 4, 2015

I've committed a fix that emits an Exception instead of an AssertError as expected. This somehow got through in the PR review that was actually supposed to get this fixed. It will now result in an error message displayed in the browser (to avoid the error completely, replace "%" with "%25" to get valid URL encoding).

The fix will be in the upcoming 0.7.26 version.

@s-ludwig s-ludwig closed this in 5331c48 Nov 4, 2015

@danielkasza

This comment has been minimized.

Show comment
Hide comment
@danielkasza

danielkasza commented Nov 4, 2015

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment