Strip trailing space from CAP REQ

Mentioned in #770