mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Update formatting
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
func handlerBad(w http.ResponseWriter, r *http.Request) {
|
||||
c := http.Cookie{
|
||||
Name: "session",
|
||||
Value: "secret",
|
||||
Name: "session",
|
||||
Value: "secret",
|
||||
}
|
||||
http.SetCookie(w, &c) // BAD: The HttpOnly flag is set to false by default.
|
||||
}
|
||||
|
||||
@@ -6,16 +6,16 @@ import (
|
||||
|
||||
func handlerBad(w http.ResponseWriter, r *http.Request) {
|
||||
c := http.Cookie{
|
||||
Name: "session",
|
||||
Value: "secret",
|
||||
Name: "session",
|
||||
Value: "secret",
|
||||
}
|
||||
http.SetCookie(w, &c) // BAD: The Secure flag is set to false by default.
|
||||
}
|
||||
|
||||
func handlerGood(w http.ResponseWriter, r *http.Request) {
|
||||
c := http.Cookie{
|
||||
Name: "session",
|
||||
Value: "secret",
|
||||
Name: "session",
|
||||
Value: "secret",
|
||||
Secure: true,
|
||||
}
|
||||
http.SetCookie(w, &c) // GOOD: The Secure flag is set to true.
|
||||
|
||||
@@ -16,8 +16,8 @@ func handler1(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func handler2(w http.ResponseWriter, r *http.Request) {
|
||||
c := http.Cookie{
|
||||
Name: "session", // $ Source
|
||||
Value: "secret",
|
||||
Name: "session", // $ Source
|
||||
Value: "secret",
|
||||
Secure: false,
|
||||
}
|
||||
http.SetCookie(w, &c) // $ Alert // BAD: Secure explicitly set to false
|
||||
@@ -25,8 +25,8 @@ func handler2(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func handler3(w http.ResponseWriter, r *http.Request) {
|
||||
c := http.Cookie{
|
||||
Name: "session",
|
||||
Value: "secret",
|
||||
Name: "session",
|
||||
Value: "secret",
|
||||
Secure: true,
|
||||
}
|
||||
http.SetCookie(w, &c) // GOOD: Secure explicitly set to true
|
||||
@@ -53,8 +53,8 @@ func handler5(w http.ResponseWriter, r *http.Request) {
|
||||
func handler6(w http.ResponseWriter, r *http.Request) {
|
||||
val := false
|
||||
c := http.Cookie{
|
||||
Name: "session", // $ Source
|
||||
Value: "secret",
|
||||
Name: "session", // $ Source
|
||||
Value: "secret",
|
||||
Secure: val,
|
||||
}
|
||||
http.SetCookie(w, &c) // $ Alert // BAD: Secure explicitly set to false
|
||||
@@ -63,8 +63,8 @@ func handler6(w http.ResponseWriter, r *http.Request) {
|
||||
func handler7(w http.ResponseWriter, r *http.Request) {
|
||||
val := true
|
||||
c := http.Cookie{
|
||||
Name: "session",
|
||||
Value: "secret",
|
||||
Name: "session",
|
||||
Value: "secret",
|
||||
Secure: val,
|
||||
}
|
||||
http.SetCookie(w, &c) // GOOD: Secure explicitly set to true
|
||||
|
||||
Reference in New Issue
Block a user