question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting a deprecated header should not break

See original GitHub issue

The current behavior prevent from simply replacing https by http2 in existing peace of software

It should not throw a breaking exception. Instead It should:

  • log a deprecation warning
  • either set the header anyway (if setting it has no impact), or drop it (if it is no longer meaningful) or migrate it if it is replaced by new header(s).

But in all cases, the request should be processed

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
pavelcommented, Sep 30, 2016

@nwgh

I’m not so sure - there’s no better way to get someone to fix their code than by throwing a breaking exception!

I disagree, because someone might be a 3rd party HTTP/1 server, for example, CouchDB, which uses only HTTP/1. You’re forgetting that node-http2 can and will be used as a proxy and for now mostly as HTTP/2 to HTTP/1. This should be focused around actual usage and not “programming best practices”. You can add strict mode for those who want to be as close to spec as possible.

4reactions
pavelcommented, Feb 23, 2017

@DaSchTour You can use node-spdy instead as it does handle such cases. (I assume that the reader understands that this advice is not advertisement of node-spdy, and just a library to workaround the issue. No comparison should be implied from my comment).

BrowserSync usage example:

// First run: npm install browser-sync spdy
const bs = require('browser-sync').create();

bs.init({
    server: './app',
    httpModule: 'spdy',
    https: true
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I deprecate a C++ header? - Stack Overflow
Here is a possible (albeit perhaps not too elegant) solution. Insert in the header a code like that
Read more >
Support the new Deprecation HTTP header #5724 - GitHub
The Deprecation header indicates that an API is deprecated, and shouldn't be used. It's either true , or an HTTP datetime value (the...
Read more >
modernize-deprecated-headers - clang-tidy
Some headers from C library were deprecated in C++ and are no longer welcome ... The check in its current form can break...
Read more >
Warning Options - Using the GNU Compiler Collection (GCC)
Warnings from system headers are normally suppressed, on the assumption that they usually do not indicate real problems and would only make the...
Read more >
HTTP security headers: An easy way to harden your web ...
This post provides an overview of best-practice HTTP security headers that you should be setting in your websites and applications.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found