Cross-protocol, cross-site scripting (XPSS) using HTML forms
[WebKit-https.git] / Source / WebCore / platform / network / cocoa / ResourceResponseCocoa.mm
index a6eda5c..3650c7e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006 Apple Inc.  All rights reserved.
+ * Copyright (C) 2006, 2016 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -186,6 +186,9 @@ void ResourceResponse::platformLazyInit(InitLevel initLevel)
         if ([m_nsResponse.get() isKindOfClass:[NSHTTPURLResponse class]]) {
             NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)m_nsResponse.get();
 
+            CFHTTPMessageRef messageRef = CFURLResponseGetHTTPResponse([httpResponse _CFURLResponse]);
+            RetainPtr<CFStringRef> messageString = adoptCF(CFHTTPMessageCopyVersion(messageRef));
+            m_httpVersion = String(messageString.get()).upper();
             m_httpStatusCode = [httpResponse statusCode];
             
             if (initLevel < AllFields) {