Locked uri_builder issue

  • sabato 7 luglio 2012 11:08
     
     

    Hello all,

    thank you for the refresh. Noticed lots of changes and improvements, that's great!

    And just noticed an issue with uri_builder, when building from an invalid URI.

            // #1

            {

                uri_builder ub1("http", "????dfasddsf!@#$%^&*()_+", 80);

                cout << "UB1: " << boolalpha << ub1.is_valid() << endl; // OK; Expected: false, Prints: false

            }

            // #2

            {

                uri_builder ub2;

                ub2.set_scheme("http");

                ub2.set_host("????dfasddsf!@#$%^&*()_+");

                ub2.set_port(80);

                cout << "UB2: " << boolalpha << ub2.is_valid() << endl;  // ?; Expected: false, Prints: true

            }

    Is that a bug or expected behavior?

    Thank you!


Tutte le risposte

  • lunedì 9 luglio 2012 14:32
    Proprietario
     
     

    Well, it certainly doesn't look right, does it? :-)

    I'll take a look and see what's going on.

    Niklas

  • lunedì 9 luglio 2012 15:05
    Proprietario
     
     Con risposta

    I've filed a bug on this.

    Our logic is inconsistent -- encoding the hostname in one case, not encoding it in another. Based on which case it is, the validation either finds an encoded host name or not.

    Thanks for the bug report!

    Niklas

  • lunedì 9 luglio 2012 16:29
     
     

    Thank you!