# Steps to reproduce

* Start `localstack` (version 0.10.3).
* Don't create any lambda functions.
* Run:

```sh
AWS_ACCESS_KEY_ID='a' AWS_SECRET_ACCESS_KEY='b' \
aws lambda invoke \
  --function-name 'my-func' \
  --qualifier='qual' \
  --endpoint http://localhost:4574 test.out
```

* Expected behaviour — a `ResourceNotFoundException` from `aws-cli`.
* Actual behaviour — `An error occurred (500) when calling the Invoke operation` message and a 500 response.

This bug only appears if a `qualifier` is included in the request.
import re
import os
import imp
import sys
import json
import uuid
import time
import base64
import logging
import zipfile
import threading
import traceback
import hashlib
from io import BytesIO
from datetime import datetime
from six.moves import cStringIO as StringIO
from six.moves.urllib.parse import urlparse
from flask import Flask, Response, jsonify, request
from localstack import config
from localstack.constants import TEST_AWS_ACCOUNT_ID
from localstack.services import generic_proxy