Rest: extract target variant from accept-language header
When using the accept-language header to determine the desired target
variant, use only a single language code from the header, instead of the
entire string. Using the entire string was causing failures in ETag
processing, since the accept-language header may contain spaces, while
the ETag may not.
Note that for now, we just use the first language code. In the future,
it would be nice if we could find the supported target variant that is
most preferred in the header.
Bug: T350852
Change-Id: I32af29627f68eafff6f097e2fc17723d2ebb39fa