LEFT | RIGHT |
1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
2 | 2 |
3 #include "PluginWbPassThrough.h" | 3 #include "PluginWbPassThrough.h" |
4 #include "PluginClient.h" | 4 #include "PluginClient.h" |
5 #include "PluginClientFactory.h" | 5 #include "PluginClientFactory.h" |
6 #include "PluginFilter.h" | 6 #include "PluginFilter.h" |
7 #include "PluginSettings.h" | 7 #include "PluginSettings.h" |
8 #include "PluginClass.h" | 8 #include "PluginClass.h" |
9 #include "PluginSystem.h" | 9 #include "PluginSystem.h" |
10 #include <WinInet.h> | 10 #include <WinInet.h> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 if (FAILED(hr)) | 60 if (FAILED(hr)) |
61 { | 61 { |
62 return ""; | 62 return ""; |
63 } | 63 } |
64 return ExtractHttpHeader<std::string>(buf, "Accept:", "\r\n"); | 64 return ExtractHttpHeader<std::string>(buf, "Accept:", "\r\n"); |
65 } | 65 } |
66 | 66 |
67 bool IsXmlHttpRequest(const std::wstring& additionalHeaders) | 67 bool IsXmlHttpRequest(const std::wstring& additionalHeaders) |
68 { | 68 { |
69 auto requestedWithHeader = ExtractHttpHeader<std::wstring>(additionalHeaders
, L"X-Requested-With:", L"\n"); | 69 auto requestedWithHeader = ExtractHttpHeader<std::wstring>(additionalHeaders
, L"X-Requested-With:", L"\n"); |
70 return TrimString(requestedWithHeader) == L"XMLHttpRequest"; | 70 if(TrimString(requestedWithHeader) == L"XMLHttpRequest") |
| 71 { |
| 72 return true; |
| 73 } |
| 74 // CORS |
| 75 auto originHeader = ExtractHttpHeader<std::wstring>(additionalHeaders, L"Ori
gin:", L"\n"); |
| 76 return !TrimString(originHeader).empty(); |
71 } | 77 } |
72 } | 78 } |
73 | 79 |
74 WBPassthruSink::WBPassthruSink() | 80 WBPassthruSink::WBPassthruSink() |
75 : m_currentPositionOfSentPage(0) | 81 : m_currentPositionOfSentPage(0) |
76 , m_contentType(CFilter::EContentType::contentTypeAny) | 82 , m_contentType(CFilter::EContentType::contentTypeAny) |
77 , m_blockedInTransaction(false) | 83 , m_blockedInTransaction(false) |
78 { | 84 { |
79 } | 85 } |
80 | 86 |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 400 |
395 STDMETHODIMP WBPassthru::LockRequest(/* [in] */ DWORD options) | 401 STDMETHODIMP WBPassthru::LockRequest(/* [in] */ DWORD options) |
396 { | 402 { |
397 return BaseClass::LockRequest(options); | 403 return BaseClass::LockRequest(options); |
398 } | 404 } |
399 | 405 |
400 STDMETHODIMP WBPassthru::UnlockRequest() | 406 STDMETHODIMP WBPassthru::UnlockRequest() |
401 { | 407 { |
402 return BaseClass::UnlockRequest(); | 408 return BaseClass::UnlockRequest(); |
403 } | 409 } |
LEFT | RIGHT |