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

Invalid permission policy parser #194

Closed
ccxdev opened this issue Aug 9, 2023 · 3 comments · Fixed by #212
Closed

Invalid permission policy parser #194

ccxdev opened this issue Aug 9, 2023 · 3 comments · Fixed by #212
Labels
bug Something isn't working
Milestone

Comments

@ccxdev
Copy link

ccxdev commented Aug 9, 2023

Version

nuxt-security: 0.14.4
nuxt: 3.6.5

Reproduction Link

Stackblitz

Steps to reproduce

// nuxt.config.ts / security.headers
security: {
  headers: {
    permissionsPolicy: {
      geolocation: ["self", '"https://api.website.com"'],
      midi: [],
      payment: [],
      camera: ["self", '"https://api.website.com"'],
      microphone: ["self", '"https://api.website.com"'],
      usb: [],
      magnetometer: [],
      "document-domain": [],
    },
  },
},

What is Expected?

geolocation=(self "https://api.website.com"), midi=(), payment=(), camera=(self "https://api.website.com"), microphone=(self "https://api.website.com"), usb=(), magnetometer=(), document-domain=()

What is actually happening?

camera=self "https://api.website.com", display-capture=(), fullscreen=(), geolocation=self "https://api.website.com", microphone=self "https://api.website.com"

Here is MDN Example

@ccxdev ccxdev added the bug Something isn't working label Aug 9, 2023
@Baroshem
Copy link
Collaborator

Baroshem commented Aug 9, 2023

Hey!

Thanks for reporting this issue!

From what I understand, this bug appears only when you are passing an array. Is that correct?

Would you be interested in fixing this bug? :)

@ccxdev
Copy link
Author

ccxdev commented Aug 9, 2023

Sure, here is PR

@Baroshem
Copy link
Collaborator

Baroshem commented Aug 9, 2023

Thank you so much @nekotoriy

I will review it pater today and will release a patch version :)

@Baroshem Baroshem added this to the 1.0.0 milestone Aug 31, 2023
@Baroshem Baroshem mentioned this issue Sep 21, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants