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

Only undo '.' escaping in field names. #12

Merged
merged 1 commit into from
Jun 27, 2016
Merged

Conversation

alienth
Copy link
Contributor

@alienth alienth commented Jun 27, 2016

Fixes cases where content which is intended to be escaped, such as VCLs containing \., becomes clobbered, as described in #11.

@alienth
Copy link
Contributor Author

alienth commented Jun 27, 2016

For the following test:

package main

import (
        "fmt"
        "github.com/sethvargo/go-fastly"
)

func main() {
        client, _ := fastly.NewClient("foo")
        myvcl := "if (req.http.host ~ \"([[:alnum:]]+)\\.([[:alnum:]]+)$\") {"
        fmt.Println(myvcl)
        vcl, _ := client.UpdateVCL(&fastly.UpdateVCLInput{Name: "myvcl", Service: "abcdef0123456789", Version: "1", Content: myvcl})
        fmt.Println(vcl.Content)
}

Current output:

if (req.http.host ~ "([[:alnum:]]+)\.([[:alnum:]]+)$") {
if (req.http.host ~ "([[:alnum:]]+).([[:alnum:]]+)$") {

Output with changes in PR:

if (req.http.host ~ "([[:alnum:]]+)\.([[:alnum:]]+)$") {
if (req.http.host ~ "([[:alnum:]]+)\.([[:alnum:]]+)$") {

@sethvargo sethvargo merged commit 708a4d3 into fastly:master Jun 27, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants