diff --git a/collects/help/bug-report.rkt b/collects/help/bug-report.rkt index 4c32ad1f56..826e19615e 100644 --- a/collects/help/bug-report.rkt +++ b/collects/help/bug-report.rkt @@ -16,8 +16,10 @@ saved-bug-report-titles/ids discard-all-saved-bug-reports) -(define bug-www-server "bugs.racket-lang.org") -(define bug-www-server-port 80) +(define (bug-server-url path) + (string->url (string-append "http://bugs.racket-lang.org/" path))) +(define bug-report-url (bug-server-url "bug-report.cgi")) +(define captcha-text-url (bug-server-url "captcha-text")) (preferences:set-default 'drracket:email "" string? #:aliases '(drscheme:email)) (preferences:set-default 'drracket:full-name "" string? #:aliases '(drscheme:full-name)) @@ -191,10 +193,6 @@ ;; initiates sending the bug report and switches the GUI's mode (define (send-bug-report) (define query (get-query)) - (define url - (string->url (format "http://~a:~a/cgi-bin/bug-report" - bug-www-server - bug-www-server-port))) (define post-data (parameterize ([current-alist-separator-mode 'amp]) (string->bytes/utf-8 (alist->form-urlencoded query)))) @@ -207,11 +205,9 @@ (λ () (with-handlers ([exn:fail? (λ (x) (channel-put exn-chan x))]) (parameterize ([current-alist-separator-mode 'amp]) - (call/input-url - url - (case-lambda - [(x) (post-pure-port x post-data)] - [(x y) (post-pure-port x post-data y)]) + (call/input-url + bug-report-url + (lambda (x) (post-pure-port x post-data)) (lambda (port) (define response-text (new html-text%)) (render-html-to-text port response-text #t #f) diff --git a/collects/meta/web/minis/bugs.rkt b/collects/meta/web/minis/bugs.rkt index 9af481a520..2855413903 100644 --- a/collects/meta/web/minis/bugs.rkt +++ b/collects/meta/web/minis/bugs.rkt @@ -261,11 +261,13 @@ (define captcha-text ;; This is currently empty -- help/bug-report.rkt will poll it for ;; text that is used for a captcha challenge question, and if it's not - ;; empty, then it will show that in the dialog. It's intended to be - ;; used in the future if spam bug reports that use drracket (or racket - ;; code) directly become a problem. In this case, adding a challenge - ;; here will make existing installations start asking for an answer. - ;; (And this could be done with a changes-on-each-build basis, or some - ;; script that will create and remember short-lived captcha - ;; challenges.) + ;; empty, then it will show that in an input dialog. It's intended to + ;; be used in the future if spam bug reports that use drracket (or + ;; racket code) directly become a problem. In this case, adding a + ;; challenge here will make existing installations start asking for an + ;; answer. (And this could be done with a changes-on-each-build + ;; basis, or some script that will create and remember short-lived + ;; captcha challenges.) Note that the text should be a complete text + ;; for a question, including a "?" and instructions. It is used as is + ;; in the `message' argument for `get-text-from-user'. @plain[#:file "captcha-text" #:newline #f]{})