diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | jobs/basejob.cpp | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index cbf1cfd9..3018d987 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ script: - cd .. - qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" - make all -- $VALGRIND ./qmc-example "$QMC_TEST_USER" "$QMC_TEST_PWD" qmc-example-travis '#qmc-test:matrix.org' "Travis CI job $TRAVIS_JOB_NUMBER" +- if [ "$QMC_TEST_USER" != "" ]; then $VALGRIND ./qmc-example "$QMC_TEST_USER" "$QMC_TEST_PWD" qmc-example-travis '#qmc-test:matrix.org' "Travis CI job $TRAVIS_JOB_NUMBER"; fi notifications: webhooks: diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index 7669d1d4..981b75b1 100644 --- a/jobs/basejob.cpp +++ b/jobs/basejob.cpp @@ -282,9 +282,12 @@ bool checkContentType(const QByteArray& type, const QByteArrayList& patterns) if (patterns.isEmpty()) return true; + // ignore possible appendixes of the content type + const auto ctype = type.split(';').front(); + for (const auto& pattern: patterns) { - if (pattern.startsWith('*') || type == pattern) // Fast lane + if (pattern.startsWith('*') || ctype == pattern) // Fast lane return true; auto patternParts = pattern.split('/'); @@ -292,7 +295,7 @@ bool checkContentType(const QByteArray& type, const QByteArrayList& patterns) "BaseJob: Expected content type should have up to two" " /-separated parts; violating pattern: " + pattern); - if (type.split('/').front() == patternParts.front() && + if (ctype.split('/').front() == patternParts.front() && patternParts.back() == "*") return true; // Exact match already went on fast lane } |