http

Which request headers can be used for a browser/client fingerprint?

限于喜欢 提交于 2021-01-02 20:06:58
问题 For added security our server keeps track of the browser fingerprint. At the moment we use the following headers: 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR' (take the first non-empty as the client-IP) HTTP_ACCEPTxxxx HTTP_USER_AGENT Are there any more (optional) headers that can be used? What in general is the best 'algorithm' to calculate the client fingerprint? 回答1: you can use a unique

Which request headers can be used for a browser/client fingerprint?

旧城冷巷雨未停 提交于 2021-01-02 20:02:01
问题 For added security our server keeps track of the browser fingerprint. At the moment we use the following headers: 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR' (take the first non-empty as the client-IP) HTTP_ACCEPTxxxx HTTP_USER_AGENT Are there any more (optional) headers that can be used? What in general is the best 'algorithm' to calculate the client fingerprint? 回答1: you can use a unique

Check errors when calling http.ResponseWriter.Write()

守給你的承諾、 提交于 2021-01-02 05:46:35
问题 Say I have this http handler: func SomeHandler(w http.ResponseWriter, r *http.Request) { data := GetSomeData() _, err := w.Write(data) } Should I check the error returned by w.Write ? Examples I've seen just ignore it and do nothing. Also, functions like http.Error() do not return an error to be handled. 回答1: It's up to you. My advice is that unless the documentation of some method / function explicitly states that it never returns a non- nil error (such as bytes.Buffer.Write()), always check

What status code should we return if the POST succeeds but does not result in creating anything new?

∥☆過路亽.° 提交于 2021-01-02 05:32:25
问题 We have an endpoint which when you post create a new version of resource and returns a 201 and the location of the newly created resource. It determines the new version number based on a comparison of the current version and the version being posted (using a semver like ruleset). If the version you post is identical to the existing version then no version number is updated. What should we return in this case? We could just return a 201 even though we have not technically created anything. I

For Login GET or POST? [duplicate]

纵饮孤独 提交于 2021-01-02 03:51:45
问题 This question already has answers here : Is either GET or POST more secure than the other? (27 answers) Whats the difference between GET and POST encryption? (5 answers) Closed 3 years ago . I want to know which HTTP method i use for developing a login API, GET or POST ?. I have developed my login API in PHP using post method, but my BOSS say that, why you use POST method instead of GET method. 回答1: Always POST , and preferably with SSL (as in: https://... ). Because the parameters in GET get

For Login GET or POST? [duplicate]

 ̄綄美尐妖づ 提交于 2021-01-02 03:49:37
问题 This question already has answers here : Is either GET or POST more secure than the other? (27 answers) Whats the difference between GET and POST encryption? (5 answers) Closed 3 years ago . I want to know which HTTP method i use for developing a login API, GET or POST ?. I have developed my login API in PHP using post method, but my BOSS say that, why you use POST method instead of GET method. 回答1: Always POST , and preferably with SSL (as in: https://... ). Because the parameters in GET get

How to implement HSTS in my website

天大地大妈咪最大 提交于 2021-01-01 07:06:13
问题 I've a website (domain from godaddy and hosted in hostgator). As I updated the certificates, manually, I can redirect my site to https, but it is always going to http from google search. After searching online, I got to know that Considering Strict-Transport-Security: max-age=15768000 as result of curl -i -L on target domain will work for my need as it will force a browser to open the website in https. But I'm confused about how to implement this to my website. Can anyone help me on this ?

JavaScript: How can I POST an arbitrary request body to a server?

こ雲淡風輕ζ 提交于 2021-01-01 06:24:57
问题 Normal, we can send an Ajax request or submit a form to a server, which in the HTTP request body would be encoded like this: name=helloworld&age=123 . Now our server only accepts JSON data as the request body. Is there a way to change the encoding method of the request body in JavaScript? 回答1: HTML forms give you three options for encoding the data. text/plain is useful only for debugging (and not very useful even when given browser developer tools), and neither of the other two are JSON.

JavaScript: How can I POST an arbitrary request body to a server?

最后都变了- 提交于 2021-01-01 06:23:12
问题 Normal, we can send an Ajax request or submit a form to a server, which in the HTTP request body would be encoded like this: name=helloworld&age=123 . Now our server only accepts JSON data as the request body. Is there a way to change the encoding method of the request body in JavaScript? 回答1: HTML forms give you three options for encoding the data. text/plain is useful only for debugging (and not very useful even when given browser developer tools), and neither of the other two are JSON.

JavaScript: How can I POST an arbitrary request body to a server?

纵饮孤独 提交于 2021-01-01 06:21:09
问题 Normal, we can send an Ajax request or submit a form to a server, which in the HTTP request body would be encoded like this: name=helloworld&age=123 . Now our server only accepts JSON data as the request body. Is there a way to change the encoding method of the request body in JavaScript? 回答1: HTML forms give you three options for encoding the data. text/plain is useful only for debugging (and not very useful even when given browser developer tools), and neither of the other two are JSON.