Ticket #137 (closed defect: wontfix)
String resource returned as plain text instead of (declared) data contract
| Reported by: | Philipp Sumi <sumip@…> | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 2.0 |
| Component: | Codecs | Version: | |
| Keywords: | Cc: | ||
| Time remaining: | 1d | Blocked By: | |
| Time spent: | 1d | Time planned: | 1d |
| Blocking: |
Description (last modified by serialseb) (diff)
Declaring a string resource as data contract might return plain text rather than XML, probably depending on the ACCEPT headers sent with the request:
ResourceSpace.Has.ResourcesOfType<string>() .AtUri(uris.CreateFolderPathUri) .HandledBy<FolderPathCreationHandler>() .AsXmlDataContract();
Related discussion: http://groups.google.com/group/openrasta/browse_thread/thread/fdde7db2d8f982d4
Here's what's requested/returned with IE
GET http://127.0.0.1:56789/folders/combinedpath?parentfolder=/&foldername... HTTP/1.1 Accept: application/x-ms-application, image/jpeg, application/xaml +xml, image/gif, image/pjpeg, application/x-ms-xbap, application/ vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */* Accept-Language: de-CH User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E) Accept-Encoding: gzip, deflate Connection: Keep-Alive Host: 127.0.0.1:56789 HTTP/1.1 200 OK Server: ASP.NET Development Server/9.0.0.0 Date: Wed, 10 Mar 2010 19:08:52 GMT X-AspNet-Version: 2.0.50727 Content-Length: 11 Cache-Control: private Content-Type: text/plain; charset=ISO-8859-1 Connection: Close /readme.txt
Here's what's requested / returned with Firefox:
GET http://127.0.0.1:56789/folders/combinedpath?parentfolder=/&foldername... HTTP/1.1 Host: 127.0.0.1:56789 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/ *;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive HTTP/1.1 200 OK Server: ASP.NET Development Server/9.0.0.0 Date: Wed, 10 Mar 2010 19:12:35 GMT X-AspNet-Version: 2.0.50727 Content-Length: 131 Cache-Control: private Content-Type: application/xml Connection: Close <?xml version="1.0" encoding="utf-8"?> <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">/ readme.txt</string>
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
