Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use wkeNetSetHTTPHeaderField ? #595

Open
lexesv opened this issue Oct 13, 2024 · 2 comments
Open

How to use wkeNetSetHTTPHeaderField ? #595

lexesv opened this issue Oct 13, 2024 · 2 comments

Comments

@lexesv
Copy link

lexesv commented Oct 13, 2024

Hello.
Please help. No headers are added to the request.

bool LoadUrlBeginCallback(wkeWebView webView, void *param, const utf8 *url, wkeNetJob job) {
    wkeNetSetHTTPHeaderField(job, (const wchar_t *) "accept", (const wchar_t *) "application/json, text/javascript, */*; q=0.01", false);
    wkeNetSetHTTPHeaderField(job, (const wchar_t *) "x-requested-with", (const wchar_t *) "XMLHttpRequest", false);
    wkeNetHookRequest(job);
    return false;
}

wke version 1.02
blink build 98096
build time Sat Aug 5 14:09:29 2023

void initBlink() {

    char cCurrentPath[FILENAME_MAX];
    GetCurrentDir(cCurrentPath, sizeof(cCurrentPath));
    char dllpath[MAX_PATH];
    strcpy(dllpath, (const char *) cCurrentPath);
    strcat(dllpath, "\\node.dll");

    size_t cSize = strlen(dllpath) + 1;
    wchar_t *wdllpath = (wchar_t *) malloc(sizeof(wchar_t) * cSize);
    mbstowcs(wdllpath, dllpath, cSize);

    HMODULE hMod = LoadLibraryW(wdllpath);
    FN_wkeInitializeEx wkeInitializeExFunc = (FN_wkeInitializeEx) GetProcAddress(hMod, "wkeInitializeEx");
    wkeInitializeExFunc((wkeSettings *) 0);
    WKE_FOR_EACH_DEFINE_FUNCTION(WKE_GET_PTR_ITERATOR0, WKE_GET_PTR_ITERATOR1, WKE_GET_PTR_ITERATOR2,
                                 WKE_GET_PTR_ITERATOR3,
                                 WKE_GET_PTR_ITERATOR4, WKE_GET_PTR_ITERATOR5, WKE_GET_PTR_ITERATOR6,
                                 WKE_GET_PTR_ITERATOR11);

    free(wdllpath);
}

Maybe a newer version of node.dll is needed? If it is, can you share it?

@weolar
Copy link
Owner

weolar commented Oct 13, 2024

wkeNetSetHTTPHeaderField(job, (const wchar_t *) L"accept", (const wchar_t *) L"application/json, text/javascript, /; q=0.01", false);
wkeNetSetHTTPHeaderField(job, (const wchar_t *) L"x-requested-with", (const wchar_t *) L"XMLHttpRequest", false);

@lexesv
Copy link
Author

lexesv commented Oct 13, 2024

wkeNetSetHTTPHeaderField(job, (const wchar_t *) L"accept", (const wchar_t *) L"application/json, text/javascript, /; q=0.01", false); wkeNetSetHTTPHeaderField(job, (const wchar_t *) L"x-requested-with", (const wchar_t *) L"XMLHttpRequest", false);

Thank you very very very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants