GithubHelp home page GithubHelp logo

Comments (5)

kedixa avatar kedixa commented on August 15, 2024

std::string name;
std::string value;
/* Print request. */
fprintf(stderr, "%s %s %s\r\n", req->get_method(),
req->get_http_version(),
req->get_request_uri());
protocol::HttpHeaderCursor req_cursor(req);
while (req_cursor.next(name, value))
fprintf(stderr, "%s: %s\r\n", name.c_str(), value.c_str());
fprintf(stderr, "\r\n");

from workflow.

ffreality avatar ffreality commented on August 15, 2024

Hi, thank you very much for your response.
I wrote your suggestion like this for UE5.

bool UHttpRequestWf::GetAllHeaders(TMap<FString, FString>& Out_Headers)
{
	if (!this->Task)
	{
		return false;
	}

	std::string TempName;
	std::string TempValue;

	protocol::HttpHeaderCursor req_cursor(this->Task->get_req());

	TMap<FString, FString> Temp_Headers;
	while (req_cursor.next(TempName, TempValue))
	{
		FString Key = TempName.c_str();
		FString Value = TempValue.c_str();

		Temp_Headers.Add(Key, Value);
	}

	if (Temp_Headers.IsEmpty())
	{
		return false;
	}

	else
	{
		Out_Headers = Temp_Headers;
		return true;
	}
}

I works but like my other issue, #1572
If there is a Turkish character in any header's name or value, while loop doesn't start.
It doesn't matter if header with Turkish character is first entry or not.

from workflow.

Barenboim avatar Barenboim commented on August 15, 2024

According to HTTP protocol, HTTP header should not contain any non-ASCII character. And I do not think you have received a legal HTTP request.

if ((signed char)header_value[i] <= 0)

But as a server, when a request is illegal, user's process should not be called. Are you sure your function GetAllHeaders is called?

from workflow.

Barenboim avatar Barenboim commented on August 15, 2024

The framework will reply an HTTP/1.1 400 Bad Request message automaticly. Your process is not called.

from workflow.

ffreality avatar ffreality commented on August 15, 2024

So, we close this too.

from workflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.