Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated Resyntax fixes #30

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions http-easy-lib/http-easy/private/contract.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
(hash/c symbol? (or/c bytes? string?)))

(define form-data/c
(listof (cons/c symbol? (or/c false/c string?))))
(listof (cons/c symbol? (or/c #f string?))))

(define query-params/c
(listof (cons/c symbol? (or/c false/c string?))))
(listof (cons/c symbol? (or/c #f string?))))

(define auth-procedure/c
(-> url? headers/c query-params/c (values headers/c query-params/c)))
Expand Down
7 changes: 2 additions & 5 deletions http-easy-lib/http-easy/private/payload.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,8 @@
(lambda (in out)
(gzip-through-ports in out #f (current-seconds))))))

(define (json-payload v)
(lambda (hs)
(values
(hash-set hs 'content-type #"application/json; charset=utf-8")
(jsexpr->bytes v))))
(define ((json-payload v) hs)
(values (hash-set hs 'content-type #"application/json; charset=utf-8") (jsexpr->bytes v)))

(define ((pure-payload v) hs)
(values hs v))
Expand Down
4 changes: 2 additions & 2 deletions http-easy-lib/http-easy/private/pool.rkt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#lang racket/base

(require (prefix-in d: data/pool)
net/http-client
(require net/http-client
racket/contract/base
(prefix-in d: data/pool)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna skip this one as discussed on Discord and in jackfirth/resyntax#432 .

"error.rkt"
"logger.rkt"
"timeout.rkt")
Expand Down
2 changes: 1 addition & 1 deletion http-easy-lib/http-easy/private/session.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
[(301 302 303) 'get]
[(307) method])
#:headers (hash-remove headers 'authorization)
#:auth (if (same-origin? dest-url u) auth #f)
#:auth (and (same-origin? dest-url u) auth)
#:history (cons resp history)
#:redirects (sub1 redirects-remaining)))]

Expand Down
2 changes: 1 addition & 1 deletion http-easy-lib/http-easy/private/timeout.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
[make-request-timeout-evt (-> timeout-config? evt?)]))

(define timeout/c
(or/c false/c (and/c real? positive?)))
(or/c #f (and/c real? positive?)))

(struct timeout-config (lease connect request)
#:transparent)
Expand Down
2 changes: 1 addition & 1 deletion http-easy-lib/http-easy/private/url.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@

(define (is-percent-encoded? s [encode uri-encode])
(define num-%-matches (length (regexp-match* #rx"%" s)))
(or (and (> num-%-matches 0)
(or (and (positive? num-%-matches)
Copy link
Owner

@Bogdanp Bogdanp Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also going to skip this one because I like the visual (conceptual?) "symmetry" of

(and (> x ...)
     (= x ...))

(= num-%-matches (length (regexp-match* #px"%[a-fA-F0-9]{2}" s))))
(and (eq? encode form-urlencoded-encode)
(regexp-match? #rx"[+]" s))))
Expand Down
Loading