Bug 126810 - [Win] Application name in user agent string is truncated.
Summary: [Win] Application name in user agent string is truncated.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-11 01:03 PST by peavo
Modified: 2014-01-14 10:38 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.38 KB, patch)
2014-01-11 01:08 PST, peavo
no flags Details | Formatted Diff | Diff
Patch (1.38 KB, patch)
2014-01-11 01:47 PST, peavo
no flags Details | Formatted Diff | Diff
Patch (1.32 KB, patch)
2014-01-11 13:20 PST, peavo
no flags Details | Formatted Diff | Diff
Patch (1.37 KB, patch)
2014-01-13 07:52 PST, peavo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description peavo 2014-01-11 01:03:01 PST
The application name part of the user agent string is cut off after the first letter.

We need to make the application name string 8 bit.
Comment 1 peavo 2014-01-11 01:08:57 PST
Created attachment 220924 [details]
Patch
Comment 2 peavo 2014-01-11 01:47:57 PST
Created attachment 220925 [details]
Patch
Comment 3 Anders Carlsson 2014-01-11 08:07:09 PST
Comment on attachment 220925 [details]
Patch

This won't work if the application name contains 16-bit characters. Maybe something in the network layer is wrong?
Comment 4 Brent Fulgham 2014-01-11 09:40:39 PST
Comment on attachment 220925 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=220925&action=review

> Source/WebKit/win/WebView.cpp:3186
> +    m_applicationName = String::make8BitFrom16BitSource(applicationName16.characters16(), applicationName16.length());

Maybe this should just be applicationName16.utf8().data().
Comment 5 peavo 2014-01-11 13:20:23 PST
Created attachment 220945 [details]
Patch
Comment 6 peavo 2014-01-11 13:21:18 PST
(In reply to comment #4)
> (From update of attachment 220925 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=220925&action=review
> 
> > Source/WebKit/win/WebView.cpp:3186
> > +    m_applicationName = String::make8BitFrom16BitSource(applicationName16.characters16(), applicationName16.length());
> 
> Maybe this should just be applicationName16.utf8().data().

Thanks for looking into this, guys :) Updated patch according to comments.
Comment 7 Anders Carlsson 2014-01-11 16:51:09 PST
Comment on attachment 220945 [details]
Patch

I don't think this is quite right either. m_applicationName is already Unicode encoded.
Comment 8 peavo 2014-01-13 07:52:31 PST
Created attachment 221042 [details]
Patch
Comment 9 peavo 2014-01-14 07:05:05 PST
(In reply to comment #8)
> Created an attachment (id=221042) [details]
> Patch

Updated patch, the root of the problem seems to be a missing 8-bit check in the string concatenation.
Comment 10 WebKit Commit Bot 2014-01-14 10:38:12 PST
Comment on attachment 221042 [details]
Patch

Clearing flags on attachment: 221042

Committed r161983: <http://trac.webkit.org/changeset/161983>
Comment 11 WebKit Commit Bot 2014-01-14 10:38:15 PST
All reviewed patches have been landed.  Closing bug.