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

Send headers at connection for HTTP Server observe property #1067

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

relu91
Copy link
Member

@relu91 relu91 commented Sep 4, 2023

Fix #1065. We are now using the same policy that we used for events.

Update: About tests, the current test suite is pretty messy. If you have ideas on how to start testing and better organizing the HTTP server feel free to write a proposal.

We are using the same policy of events that send headers at connection.

fix eclipse-thingweb#1065
@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.05% ⚠️

Comparison is base (7c00309) 75.38% compared to head (61c6ecb) 75.33%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1067      +/-   ##
==========================================
- Coverage   75.38%   75.33%   -0.05%     
==========================================
  Files          80       80              
  Lines       15443    15452       +9     
  Branches     1477     1477              
==========================================
  Hits        11641    11641              
- Misses       3766     3775       +9     
  Partials       36       36              
Files Changed Coverage Δ
...ckages/binding-http/src/routes/property-observe.ts 18.34% <0.00%> (-1.66%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@danielpeintner danielpeintner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @relu91 mentioned it matches with what we do for events

if (!res.headersSent) {
// We are polite and use the same request as long as the client
// does not close the connection (or we hit the timeout; see below).
// Therefore we are sending the headers
// only if we didn't have sent them before.
res.setHeader("Content-Type", value.type);
res.writeHead(200);
}

@relu91 relu91 merged commit 604144e into eclipse-thingweb:master Sep 5, 2023
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

Successfully merging this pull request may close these issues.

emitPropertyChange does not add content type to header
2 participants