Skip to content

Commit

Permalink
try spoof
Browse files Browse the repository at this point in the history
  • Loading branch information
Dierk Koenig committed Jan 9, 2024
1 parent b6dc38d commit 513661b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions grails-app/conf/application.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ grails.plugin.springsecurity.filterChain.chainMap = [
[pattern: '/**/images/**', access: ['permitAll']],
[pattern: '/**/favicon.ico', access: ['permitAll']],
[pattern: "/login/auth", access: ["permitAll"]],
[pattern: "/spoof/**", access: ["permitAll"]],
[pattern: "/person/**" , access: ['ROLE_ADMIN']], // cannot use constant here :-(
[pattern: "/room/**" , access: ['ROLE_ADMIN']],
[pattern: "/**" , access: ['ROLE_ADMIN', 'ROLE_GUEST']],
Expand Down
23 changes: 23 additions & 0 deletions grails-app/controllers/rooms/SpoofController.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package rooms

class SpoofController {

final SAFARI = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1.2 Safari/605.1.15'
final CHROME = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
final FIREFOX = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:120.0) Gecko/20100101 Firefox/120.0'


def index() {
String result = '<pre>';

result += '\n' + 'Headers:'
request.getHeaderNames()
.each { headerName -> result += '\n' + "${headerName}: ${request.getHeader(headerName)}" }


result += '</pre>'
render text: result.toString()


}
}

0 comments on commit 513661b

Please sign in to comment.