最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Identifying the version of a client web app during HTTP requests - Stack Overflow

programmeradmin5浏览0评论

We have a single page application which we ship changes to on a regular basis. On rare occasion, a version of the client has a bug and submits a bad request to the server. Even after you ship out an update, there's a possibility old versions of the client can linger.

In these circumstances, it would be useful for the client to send a version identifier along with our requests so that we know whether which version of the code base initiated it.

Are there any existing best practices for this scenario? Attaching an extra header seems like a simple solution, but I don't want to tread new ground if this problem has already been addressed.

We have a single page application which we ship changes to on a regular basis. On rare occasion, a version of the client has a bug and submits a bad request to the server. Even after you ship out an update, there's a possibility old versions of the client can linger.

In these circumstances, it would be useful for the client to send a version identifier along with our requests so that we know whether which version of the code base initiated it.

Are there any existing best practices for this scenario? Attaching an extra header seems like a simple solution, but I don't want to tread new ground if this problem has already been addressed.

Share Improve this question asked Jul 5, 2013 at 14:55 Brad KochBrad Koch 20.3k20 gold badges112 silver badges140 bronze badges 3
  • That's what User-Agent is for. – SLaks Commented Jul 5, 2013 at 14:57
  • 1 Sure, but we're talking about a client residing in the web browser here. Is it really wise (or even possible) to tweak something that is normally defined by the browser? – Brad Koch Commented Jul 5, 2013 at 14:59
  • You're right; that's impossible. – SLaks Commented Jul 7, 2013 at 12:03
Add a ment  | 

1 Answer 1

Reset to default 16

We're simply using custom HTTP X- headers. Something like X-Client-Version and X-Client-Name.

发布评论

评论列表(0)

  1. 暂无评论